{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 72,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import numpy as np\n",
    "from sklearn.model_selection import GridSearchCV\n",
    "from sklearn.neighbors import KNeighborsClassifier\n",
    "from sklearn.discriminant_analysis import LinearDiscriminantAnalysis as LDA\n",
    "from sklearn.preprocessing import StandardScaler\n",
    "from sklearn.naive_bayes import GaussianNB\n",
    "from sklearn.ensemble import VotingClassifier, RandomForestClassifier\n",
    "from sklearn.linear_model import LogisticRegression\n",
    "from sklearn.model_selection import train_test_split\n",
    "from sklearn.model_selection import KFold\n",
    "from sklearn.model_selection import cross_val_predict, cross_val_score\n",
    "from sqlalchemy import column\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 73,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th>569</th>\n",
       "      <th>30</th>\n",
       "      <th>malignant</th>\n",
       "      <th>benign</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>17.99</th>\n",
       "      <th>10.38</th>\n",
       "      <th>122.80</th>\n",
       "      <th>1001.0</th>\n",
       "      <th>0.11840</th>\n",
       "      <th>0.27760</th>\n",
       "      <th>0.3001</th>\n",
       "      <th>0.14710</th>\n",
       "      <th>0.2419</th>\n",
       "      <th>0.07871</th>\n",
       "      <th>1.0950</th>\n",
       "      <th>0.9053</th>\n",
       "      <th>8.589</th>\n",
       "      <th>153.40</th>\n",
       "      <th>0.006399</th>\n",
       "      <th>0.04904</th>\n",
       "      <th>0.05373</th>\n",
       "      <th>0.01587</th>\n",
       "      <th>0.03003</th>\n",
       "      <th>0.006193</th>\n",
       "      <th>25.38</th>\n",
       "      <th>17.33</th>\n",
       "      <th>184.60</th>\n",
       "      <th>2019.0</th>\n",
       "      <th>0.1622</th>\n",
       "      <th>0.6656</th>\n",
       "      <th>0.7119</th>\n",
       "      <td>0.2654</td>\n",
       "      <td>0.4601</td>\n",
       "      <td>0.11890</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20.57</th>\n",
       "      <th>17.77</th>\n",
       "      <th>132.90</th>\n",
       "      <th>1326.0</th>\n",
       "      <th>0.08474</th>\n",
       "      <th>0.07864</th>\n",
       "      <th>0.0869</th>\n",
       "      <th>0.07017</th>\n",
       "      <th>0.1812</th>\n",
       "      <th>0.05667</th>\n",
       "      <th>0.5435</th>\n",
       "      <th>0.7339</th>\n",
       "      <th>3.398</th>\n",
       "      <th>74.08</th>\n",
       "      <th>0.005225</th>\n",
       "      <th>0.01308</th>\n",
       "      <th>0.01860</th>\n",
       "      <th>0.01340</th>\n",
       "      <th>0.01389</th>\n",
       "      <th>0.003532</th>\n",
       "      <th>24.99</th>\n",
       "      <th>23.41</th>\n",
       "      <th>158.80</th>\n",
       "      <th>1956.0</th>\n",
       "      <th>0.1238</th>\n",
       "      <th>0.1866</th>\n",
       "      <th>0.2416</th>\n",
       "      <td>0.1860</td>\n",
       "      <td>0.2750</td>\n",
       "      <td>0.08902</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19.69</th>\n",
       "      <th>21.25</th>\n",
       "      <th>130.00</th>\n",
       "      <th>1203.0</th>\n",
       "      <th>0.10960</th>\n",
       "      <th>0.15990</th>\n",
       "      <th>0.1974</th>\n",
       "      <th>0.12790</th>\n",
       "      <th>0.2069</th>\n",
       "      <th>0.05999</th>\n",
       "      <th>0.7456</th>\n",
       "      <th>0.7869</th>\n",
       "      <th>4.585</th>\n",
       "      <th>94.03</th>\n",
       "      <th>0.006150</th>\n",
       "      <th>0.04006</th>\n",
       "      <th>0.03832</th>\n",
       "      <th>0.02058</th>\n",
       "      <th>0.02250</th>\n",
       "      <th>0.004571</th>\n",
       "      <th>23.57</th>\n",
       "      <th>25.53</th>\n",
       "      <th>152.50</th>\n",
       "      <th>1709.0</th>\n",
       "      <th>0.1444</th>\n",
       "      <th>0.4245</th>\n",
       "      <th>0.4504</th>\n",
       "      <td>0.2430</td>\n",
       "      <td>0.3613</td>\n",
       "      <td>0.08758</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11.42</th>\n",
       "      <th>20.38</th>\n",
       "      <th>77.58</th>\n",
       "      <th>386.1</th>\n",
       "      <th>0.14250</th>\n",
       "      <th>0.28390</th>\n",
       "      <th>0.2414</th>\n",
       "      <th>0.10520</th>\n",
       "      <th>0.2597</th>\n",
       "      <th>0.09744</th>\n",
       "      <th>0.4956</th>\n",
       "      <th>1.1560</th>\n",
       "      <th>3.445</th>\n",
       "      <th>27.23</th>\n",
       "      <th>0.009110</th>\n",
       "      <th>0.07458</th>\n",
       "      <th>0.05661</th>\n",
       "      <th>0.01867</th>\n",
       "      <th>0.05963</th>\n",
       "      <th>0.009208</th>\n",
       "      <th>14.91</th>\n",
       "      <th>26.50</th>\n",
       "      <th>98.87</th>\n",
       "      <th>567.7</th>\n",
       "      <th>0.2098</th>\n",
       "      <th>0.8663</th>\n",
       "      <th>0.6869</th>\n",
       "      <td>0.2575</td>\n",
       "      <td>0.6638</td>\n",
       "      <td>0.17300</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20.29</th>\n",
       "      <th>14.34</th>\n",
       "      <th>135.10</th>\n",
       "      <th>1297.0</th>\n",
       "      <th>0.10030</th>\n",
       "      <th>0.13280</th>\n",
       "      <th>0.1980</th>\n",
       "      <th>0.10430</th>\n",
       "      <th>0.1809</th>\n",
       "      <th>0.05883</th>\n",
       "      <th>0.7572</th>\n",
       "      <th>0.7813</th>\n",
       "      <th>5.438</th>\n",
       "      <th>94.44</th>\n",
       "      <th>0.011490</th>\n",
       "      <th>0.02461</th>\n",
       "      <th>0.05688</th>\n",
       "      <th>0.01885</th>\n",
       "      <th>0.01756</th>\n",
       "      <th>0.005115</th>\n",
       "      <th>22.54</th>\n",
       "      <th>16.67</th>\n",
       "      <th>152.20</th>\n",
       "      <th>1575.0</th>\n",
       "      <th>0.1374</th>\n",
       "      <th>0.2050</th>\n",
       "      <th>0.4000</th>\n",
       "      <td>0.1625</td>\n",
       "      <td>0.2364</td>\n",
       "      <td>0.07678</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                                                                                                                                                                                        569  \\\n",
       "17.99 10.38 122.80 1001.0 0.11840 0.27760 0.3001 0.14710 0.2419 0.07871 1.0950 0.9053 8.589 153.40 0.006399 0.04904 0.05373 0.01587 0.03003 0.006193 25.38 17.33 184.60 2019.0 0.1622 0.6656 0.7119  0.2654   \n",
       "20.57 17.77 132.90 1326.0 0.08474 0.07864 0.0869 0.07017 0.1812 0.05667 0.5435 0.7339 3.398 74.08  0.005225 0.01308 0.01860 0.01340 0.01389 0.003532 24.99 23.41 158.80 1956.0 0.1238 0.1866 0.2416  0.1860   \n",
       "19.69 21.25 130.00 1203.0 0.10960 0.15990 0.1974 0.12790 0.2069 0.05999 0.7456 0.7869 4.585 94.03  0.006150 0.04006 0.03832 0.02058 0.02250 0.004571 23.57 25.53 152.50 1709.0 0.1444 0.4245 0.4504  0.2430   \n",
       "11.42 20.38 77.58  386.1  0.14250 0.28390 0.2414 0.10520 0.2597 0.09744 0.4956 1.1560 3.445 27.23  0.009110 0.07458 0.05661 0.01867 0.05963 0.009208 14.91 26.50 98.87  567.7  0.2098 0.8663 0.6869  0.2575   \n",
       "20.29 14.34 135.10 1297.0 0.10030 0.13280 0.1980 0.10430 0.1809 0.05883 0.7572 0.7813 5.438 94.44  0.011490 0.02461 0.05688 0.01885 0.01756 0.005115 22.54 16.67 152.20 1575.0 0.1374 0.2050 0.4000  0.1625   \n",
       "\n",
       "                                                                                                                                                                                                         30  \\\n",
       "17.99 10.38 122.80 1001.0 0.11840 0.27760 0.3001 0.14710 0.2419 0.07871 1.0950 0.9053 8.589 153.40 0.006399 0.04904 0.05373 0.01587 0.03003 0.006193 25.38 17.33 184.60 2019.0 0.1622 0.6656 0.7119  0.4601   \n",
       "20.57 17.77 132.90 1326.0 0.08474 0.07864 0.0869 0.07017 0.1812 0.05667 0.5435 0.7339 3.398 74.08  0.005225 0.01308 0.01860 0.01340 0.01389 0.003532 24.99 23.41 158.80 1956.0 0.1238 0.1866 0.2416  0.2750   \n",
       "19.69 21.25 130.00 1203.0 0.10960 0.15990 0.1974 0.12790 0.2069 0.05999 0.7456 0.7869 4.585 94.03  0.006150 0.04006 0.03832 0.02058 0.02250 0.004571 23.57 25.53 152.50 1709.0 0.1444 0.4245 0.4504  0.3613   \n",
       "11.42 20.38 77.58  386.1  0.14250 0.28390 0.2414 0.10520 0.2597 0.09744 0.4956 1.1560 3.445 27.23  0.009110 0.07458 0.05661 0.01867 0.05963 0.009208 14.91 26.50 98.87  567.7  0.2098 0.8663 0.6869  0.6638   \n",
       "20.29 14.34 135.10 1297.0 0.10030 0.13280 0.1980 0.10430 0.1809 0.05883 0.7572 0.7813 5.438 94.44  0.011490 0.02461 0.05688 0.01885 0.01756 0.005115 22.54 16.67 152.20 1575.0 0.1374 0.2050 0.4000  0.2364   \n",
       "\n",
       "                                                                                                                                                                                                     malignant  \\\n",
       "17.99 10.38 122.80 1001.0 0.11840 0.27760 0.3001 0.14710 0.2419 0.07871 1.0950 0.9053 8.589 153.40 0.006399 0.04904 0.05373 0.01587 0.03003 0.006193 25.38 17.33 184.60 2019.0 0.1622 0.6656 0.7119    0.11890   \n",
       "20.57 17.77 132.90 1326.0 0.08474 0.07864 0.0869 0.07017 0.1812 0.05667 0.5435 0.7339 3.398 74.08  0.005225 0.01308 0.01860 0.01340 0.01389 0.003532 24.99 23.41 158.80 1956.0 0.1238 0.1866 0.2416    0.08902   \n",
       "19.69 21.25 130.00 1203.0 0.10960 0.15990 0.1974 0.12790 0.2069 0.05999 0.7456 0.7869 4.585 94.03  0.006150 0.04006 0.03832 0.02058 0.02250 0.004571 23.57 25.53 152.50 1709.0 0.1444 0.4245 0.4504    0.08758   \n",
       "11.42 20.38 77.58  386.1  0.14250 0.28390 0.2414 0.10520 0.2597 0.09744 0.4956 1.1560 3.445 27.23  0.009110 0.07458 0.05661 0.01867 0.05963 0.009208 14.91 26.50 98.87  567.7  0.2098 0.8663 0.6869    0.17300   \n",
       "20.29 14.34 135.10 1297.0 0.10030 0.13280 0.1980 0.10430 0.1809 0.05883 0.7572 0.7813 5.438 94.44  0.011490 0.02461 0.05688 0.01885 0.01756 0.005115 22.54 16.67 152.20 1575.0 0.1374 0.2050 0.4000    0.07678   \n",
       "\n",
       "                                                                                                                                                                                                     benign  \n",
       "17.99 10.38 122.80 1001.0 0.11840 0.27760 0.3001 0.14710 0.2419 0.07871 1.0950 0.9053 8.589 153.40 0.006399 0.04904 0.05373 0.01587 0.03003 0.006193 25.38 17.33 184.60 2019.0 0.1622 0.6656 0.7119       0  \n",
       "20.57 17.77 132.90 1326.0 0.08474 0.07864 0.0869 0.07017 0.1812 0.05667 0.5435 0.7339 3.398 74.08  0.005225 0.01308 0.01860 0.01340 0.01389 0.003532 24.99 23.41 158.80 1956.0 0.1238 0.1866 0.2416       0  \n",
       "19.69 21.25 130.00 1203.0 0.10960 0.15990 0.1974 0.12790 0.2069 0.05999 0.7456 0.7869 4.585 94.03  0.006150 0.04006 0.03832 0.02058 0.02250 0.004571 23.57 25.53 152.50 1709.0 0.1444 0.4245 0.4504       0  \n",
       "11.42 20.38 77.58  386.1  0.14250 0.28390 0.2414 0.10520 0.2597 0.09744 0.4956 1.1560 3.445 27.23  0.009110 0.07458 0.05661 0.01867 0.05963 0.009208 14.91 26.50 98.87  567.7  0.2098 0.8663 0.6869       0  \n",
       "20.29 14.34 135.10 1297.0 0.10030 0.13280 0.1980 0.10430 0.1809 0.05883 0.7572 0.7813 5.438 94.44  0.011490 0.02461 0.05688 0.01885 0.01756 0.005115 22.54 16.67 152.20 1575.0 0.1374 0.2050 0.4000       0  "
      ]
     },
     "execution_count": 73,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# read in the dataset\n",
    "df = pd.read_csv('data/breast_cancer.csv')\n",
    "\n",
    "# take a look at the data\n",
    "df.head(5)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 74,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(569, 4)"
      ]
     },
     "execution_count": 74,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# check dataset size\n",
    "df.shape\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 75,
   "metadata": {},
   "outputs": [],
   "source": [
    "# split data into inputs and targets\n",
    "X = df.drop(columns=['benign'])\n",
    "y = df['benign']\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 76,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th>569</th>\n",
       "      <th>30</th>\n",
       "      <th>malignant</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>20.47</th>\n",
       "      <th>20.67</th>\n",
       "      <th>134.70</th>\n",
       "      <th>1299.0</th>\n",
       "      <th>0.09156</th>\n",
       "      <th>0.13130</th>\n",
       "      <th>0.15230</th>\n",
       "      <th>0.10150</th>\n",
       "      <th>0.2166</th>\n",
       "      <th>0.05419</th>\n",
       "      <th>0.8336</th>\n",
       "      <th>1.7360</th>\n",
       "      <th>5.168</th>\n",
       "      <th>100.40</th>\n",
       "      <th>0.004938</th>\n",
       "      <th>0.03089</th>\n",
       "      <th>0.040930</th>\n",
       "      <th>0.016990</th>\n",
       "      <th>0.02816</th>\n",
       "      <th>0.002719</th>\n",
       "      <th>23.23</th>\n",
       "      <th>27.15</th>\n",
       "      <th>152.00</th>\n",
       "      <th>1645.0</th>\n",
       "      <th>0.1097</th>\n",
       "      <th>0.25340</th>\n",
       "      <th>0.30920</th>\n",
       "      <td>0.16130</td>\n",
       "      <td>0.3220</td>\n",
       "      <td>0.06386</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11.74</th>\n",
       "      <th>14.69</th>\n",
       "      <th>76.31</th>\n",
       "      <th>426.0</th>\n",
       "      <th>0.08099</th>\n",
       "      <th>0.09661</th>\n",
       "      <th>0.06726</th>\n",
       "      <th>0.02639</th>\n",
       "      <th>0.1499</th>\n",
       "      <th>0.06758</th>\n",
       "      <th>0.1924</th>\n",
       "      <th>0.6417</th>\n",
       "      <th>1.345</th>\n",
       "      <th>13.04</th>\n",
       "      <th>0.006982</th>\n",
       "      <th>0.03916</th>\n",
       "      <th>0.040170</th>\n",
       "      <th>0.015280</th>\n",
       "      <th>0.02260</th>\n",
       "      <th>0.006822</th>\n",
       "      <th>12.45</th>\n",
       "      <th>17.60</th>\n",
       "      <th>81.25</th>\n",
       "      <th>473.8</th>\n",
       "      <th>0.1073</th>\n",
       "      <th>0.27930</th>\n",
       "      <th>0.26900</th>\n",
       "      <td>0.10560</td>\n",
       "      <td>0.2604</td>\n",
       "      <td>0.09879</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13.47</th>\n",
       "      <th>14.06</th>\n",
       "      <th>87.32</th>\n",
       "      <th>546.3</th>\n",
       "      <th>0.10710</th>\n",
       "      <th>0.11550</th>\n",
       "      <th>0.05786</th>\n",
       "      <th>0.05266</th>\n",
       "      <th>0.1779</th>\n",
       "      <th>0.06639</th>\n",
       "      <th>0.1588</th>\n",
       "      <th>0.5733</th>\n",
       "      <th>1.102</th>\n",
       "      <th>12.84</th>\n",
       "      <th>0.004450</th>\n",
       "      <th>0.01452</th>\n",
       "      <th>0.013340</th>\n",
       "      <th>0.008791</th>\n",
       "      <th>0.01698</th>\n",
       "      <th>0.002787</th>\n",
       "      <th>14.83</th>\n",
       "      <th>18.32</th>\n",
       "      <th>94.94</th>\n",
       "      <th>660.2</th>\n",
       "      <th>0.1393</th>\n",
       "      <th>0.24990</th>\n",
       "      <th>0.18480</th>\n",
       "      <td>0.13350</td>\n",
       "      <td>0.3227</td>\n",
       "      <td>0.09326</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27.42</th>\n",
       "      <th>26.27</th>\n",
       "      <th>186.90</th>\n",
       "      <th>2501.0</th>\n",
       "      <th>0.10840</th>\n",
       "      <th>0.19880</th>\n",
       "      <th>0.36350</th>\n",
       "      <th>0.16890</th>\n",
       "      <th>0.2061</th>\n",
       "      <th>0.05623</th>\n",
       "      <th>2.5470</th>\n",
       "      <th>1.3060</th>\n",
       "      <th>18.650</th>\n",
       "      <th>542.20</th>\n",
       "      <th>0.007650</th>\n",
       "      <th>0.05374</th>\n",
       "      <th>0.080550</th>\n",
       "      <th>0.025980</th>\n",
       "      <th>0.01697</th>\n",
       "      <th>0.004558</th>\n",
       "      <th>36.04</th>\n",
       "      <th>31.37</th>\n",
       "      <th>251.20</th>\n",
       "      <th>4254.0</th>\n",
       "      <th>0.1357</th>\n",
       "      <th>0.42560</th>\n",
       "      <th>0.68330</th>\n",
       "      <td>0.26250</td>\n",
       "      <td>0.2641</td>\n",
       "      <td>0.07427</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12.72</th>\n",
       "      <th>13.78</th>\n",
       "      <th>81.78</th>\n",
       "      <th>492.1</th>\n",
       "      <th>0.09667</th>\n",
       "      <th>0.08393</th>\n",
       "      <th>0.01288</th>\n",
       "      <th>0.01924</th>\n",
       "      <th>0.1638</th>\n",
       "      <th>0.06100</th>\n",
       "      <th>0.1807</th>\n",
       "      <th>0.6931</th>\n",
       "      <th>1.340</th>\n",
       "      <th>13.38</th>\n",
       "      <th>0.006064</th>\n",
       "      <th>0.01180</th>\n",
       "      <th>0.006564</th>\n",
       "      <th>0.007978</th>\n",
       "      <th>0.01374</th>\n",
       "      <th>0.001392</th>\n",
       "      <th>13.50</th>\n",
       "      <th>17.48</th>\n",
       "      <th>88.54</th>\n",
       "      <th>553.7</th>\n",
       "      <th>0.1298</th>\n",
       "      <th>0.14720</th>\n",
       "      <th>0.05233</th>\n",
       "      <td>0.06343</td>\n",
       "      <td>0.2369</td>\n",
       "      <td>0.06922</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20.20</th>\n",
       "      <th>26.83</th>\n",
       "      <th>133.70</th>\n",
       "      <th>1234.0</th>\n",
       "      <th>0.09905</th>\n",
       "      <th>0.16690</th>\n",
       "      <th>0.16410</th>\n",
       "      <th>0.12650</th>\n",
       "      <th>0.1875</th>\n",
       "      <th>0.06020</th>\n",
       "      <th>0.9761</th>\n",
       "      <th>1.8920</th>\n",
       "      <th>7.128</th>\n",
       "      <th>103.60</th>\n",
       "      <th>0.008439</th>\n",
       "      <th>0.04674</th>\n",
       "      <th>0.059040</th>\n",
       "      <th>0.025360</th>\n",
       "      <th>0.03710</th>\n",
       "      <th>0.004286</th>\n",
       "      <th>24.19</th>\n",
       "      <th>33.81</th>\n",
       "      <th>160.00</th>\n",
       "      <th>1671.0</th>\n",
       "      <th>0.1278</th>\n",
       "      <th>0.34160</th>\n",
       "      <th>0.37030</th>\n",
       "      <td>0.21520</td>\n",
       "      <td>0.3271</td>\n",
       "      <td>0.07632</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16.46</th>\n",
       "      <th>20.11</th>\n",
       "      <th>109.30</th>\n",
       "      <th>832.9</th>\n",
       "      <th>0.09831</th>\n",
       "      <th>0.15560</th>\n",
       "      <th>0.17930</th>\n",
       "      <th>0.08866</th>\n",
       "      <th>0.1794</th>\n",
       "      <th>0.06323</th>\n",
       "      <th>0.3037</th>\n",
       "      <th>1.2840</th>\n",
       "      <th>2.482</th>\n",
       "      <th>31.59</th>\n",
       "      <th>0.006627</th>\n",
       "      <th>0.04094</th>\n",
       "      <th>0.053710</th>\n",
       "      <th>0.018130</th>\n",
       "      <th>0.01682</th>\n",
       "      <th>0.004584</th>\n",
       "      <th>17.79</th>\n",
       "      <th>28.45</th>\n",
       "      <th>123.50</th>\n",
       "      <th>981.2</th>\n",
       "      <th>0.1415</th>\n",
       "      <th>0.46670</th>\n",
       "      <th>0.58620</th>\n",
       "      <td>0.20350</td>\n",
       "      <td>0.3054</td>\n",
       "      <td>0.09519</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13.81</th>\n",
       "      <th>23.75</th>\n",
       "      <th>91.56</th>\n",
       "      <th>597.8</th>\n",
       "      <th>0.13230</th>\n",
       "      <th>0.17680</th>\n",
       "      <th>0.15580</th>\n",
       "      <th>0.09176</th>\n",
       "      <th>0.2251</th>\n",
       "      <th>0.07421</th>\n",
       "      <th>0.5648</th>\n",
       "      <th>1.9300</th>\n",
       "      <th>3.909</th>\n",
       "      <th>52.72</th>\n",
       "      <th>0.008824</th>\n",
       "      <th>0.03108</th>\n",
       "      <th>0.031120</th>\n",
       "      <th>0.012910</th>\n",
       "      <th>0.01998</th>\n",
       "      <th>0.004506</th>\n",
       "      <th>19.20</th>\n",
       "      <th>41.85</th>\n",
       "      <th>128.50</th>\n",
       "      <th>1153.0</th>\n",
       "      <th>0.2226</th>\n",
       "      <th>0.52090</th>\n",
       "      <th>0.46460</th>\n",
       "      <td>0.20130</td>\n",
       "      <td>0.4432</td>\n",
       "      <td>0.10860</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12.18</th>\n",
       "      <th>17.84</th>\n",
       "      <th>77.79</th>\n",
       "      <th>451.1</th>\n",
       "      <th>0.10450</th>\n",
       "      <th>0.07057</th>\n",
       "      <th>0.02490</th>\n",
       "      <th>0.02941</th>\n",
       "      <th>0.1900</th>\n",
       "      <th>0.06635</th>\n",
       "      <th>0.3661</th>\n",
       "      <th>1.5110</th>\n",
       "      <th>2.410</th>\n",
       "      <th>24.44</th>\n",
       "      <th>0.005433</th>\n",
       "      <th>0.01179</th>\n",
       "      <th>0.011310</th>\n",
       "      <th>0.015190</th>\n",
       "      <th>0.02220</th>\n",
       "      <th>0.003408</th>\n",
       "      <th>12.83</th>\n",
       "      <th>20.92</th>\n",
       "      <th>82.14</th>\n",
       "      <th>495.2</th>\n",
       "      <th>0.1140</th>\n",
       "      <th>0.09358</th>\n",
       "      <th>0.04980</th>\n",
       "      <td>0.05882</td>\n",
       "      <td>0.2227</td>\n",
       "      <td>0.07376</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11.28</th>\n",
       "      <th>13.39</th>\n",
       "      <th>73.00</th>\n",
       "      <th>384.8</th>\n",
       "      <th>0.11640</th>\n",
       "      <th>0.11360</th>\n",
       "      <th>0.04635</th>\n",
       "      <th>0.04796</th>\n",
       "      <th>0.1771</th>\n",
       "      <th>0.06072</th>\n",
       "      <th>0.3384</th>\n",
       "      <th>1.3430</th>\n",
       "      <th>1.851</th>\n",
       "      <th>26.33</th>\n",
       "      <th>0.011270</th>\n",
       "      <th>0.03498</th>\n",
       "      <th>0.021870</th>\n",
       "      <th>0.019650</th>\n",
       "      <th>0.01580</th>\n",
       "      <th>0.003442</th>\n",
       "      <th>11.92</th>\n",
       "      <th>15.77</th>\n",
       "      <th>76.53</th>\n",
       "      <th>434.0</th>\n",
       "      <th>0.1367</th>\n",
       "      <th>0.18220</th>\n",
       "      <th>0.08669</th>\n",
       "      <td>0.08611</td>\n",
       "      <td>0.2102</td>\n",
       "      <td>0.06784</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>114 rows × 3 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                                                                                                                                                                                                               569  \\\n",
       "20.47 20.67 134.70 1299.0 0.09156 0.13130 0.15230 0.10150 0.2166 0.05419 0.8336 1.7360 5.168  100.40 0.004938 0.03089 0.040930 0.016990 0.02816 0.002719 23.23 27.15 152.00 1645.0 0.1097 0.25340 0.30920  0.16130   \n",
       "11.74 14.69 76.31  426.0  0.08099 0.09661 0.06726 0.02639 0.1499 0.06758 0.1924 0.6417 1.345  13.04  0.006982 0.03916 0.040170 0.015280 0.02260 0.006822 12.45 17.60 81.25  473.8  0.1073 0.27930 0.26900  0.10560   \n",
       "13.47 14.06 87.32  546.3  0.10710 0.11550 0.05786 0.05266 0.1779 0.06639 0.1588 0.5733 1.102  12.84  0.004450 0.01452 0.013340 0.008791 0.01698 0.002787 14.83 18.32 94.94  660.2  0.1393 0.24990 0.18480  0.13350   \n",
       "27.42 26.27 186.90 2501.0 0.10840 0.19880 0.36350 0.16890 0.2061 0.05623 2.5470 1.3060 18.650 542.20 0.007650 0.05374 0.080550 0.025980 0.01697 0.004558 36.04 31.37 251.20 4254.0 0.1357 0.42560 0.68330  0.26250   \n",
       "12.72 13.78 81.78  492.1  0.09667 0.08393 0.01288 0.01924 0.1638 0.06100 0.1807 0.6931 1.340  13.38  0.006064 0.01180 0.006564 0.007978 0.01374 0.001392 13.50 17.48 88.54  553.7  0.1298 0.14720 0.05233  0.06343   \n",
       "...                                                                                                                                                                                                            ...   \n",
       "20.20 26.83 133.70 1234.0 0.09905 0.16690 0.16410 0.12650 0.1875 0.06020 0.9761 1.8920 7.128  103.60 0.008439 0.04674 0.059040 0.025360 0.03710 0.004286 24.19 33.81 160.00 1671.0 0.1278 0.34160 0.37030  0.21520   \n",
       "16.46 20.11 109.30 832.9  0.09831 0.15560 0.17930 0.08866 0.1794 0.06323 0.3037 1.2840 2.482  31.59  0.006627 0.04094 0.053710 0.018130 0.01682 0.004584 17.79 28.45 123.50 981.2  0.1415 0.46670 0.58620  0.20350   \n",
       "13.81 23.75 91.56  597.8  0.13230 0.17680 0.15580 0.09176 0.2251 0.07421 0.5648 1.9300 3.909  52.72  0.008824 0.03108 0.031120 0.012910 0.01998 0.004506 19.20 41.85 128.50 1153.0 0.2226 0.52090 0.46460  0.20130   \n",
       "12.18 17.84 77.79  451.1  0.10450 0.07057 0.02490 0.02941 0.1900 0.06635 0.3661 1.5110 2.410  24.44  0.005433 0.01179 0.011310 0.015190 0.02220 0.003408 12.83 20.92 82.14  495.2  0.1140 0.09358 0.04980  0.05882   \n",
       "11.28 13.39 73.00  384.8  0.11640 0.11360 0.04635 0.04796 0.1771 0.06072 0.3384 1.3430 1.851  26.33  0.011270 0.03498 0.021870 0.019650 0.01580 0.003442 11.92 15.77 76.53  434.0  0.1367 0.18220 0.08669  0.08611   \n",
       "\n",
       "                                                                                                                                                                                                               30  \\\n",
       "20.47 20.67 134.70 1299.0 0.09156 0.13130 0.15230 0.10150 0.2166 0.05419 0.8336 1.7360 5.168  100.40 0.004938 0.03089 0.040930 0.016990 0.02816 0.002719 23.23 27.15 152.00 1645.0 0.1097 0.25340 0.30920  0.3220   \n",
       "11.74 14.69 76.31  426.0  0.08099 0.09661 0.06726 0.02639 0.1499 0.06758 0.1924 0.6417 1.345  13.04  0.006982 0.03916 0.040170 0.015280 0.02260 0.006822 12.45 17.60 81.25  473.8  0.1073 0.27930 0.26900  0.2604   \n",
       "13.47 14.06 87.32  546.3  0.10710 0.11550 0.05786 0.05266 0.1779 0.06639 0.1588 0.5733 1.102  12.84  0.004450 0.01452 0.013340 0.008791 0.01698 0.002787 14.83 18.32 94.94  660.2  0.1393 0.24990 0.18480  0.3227   \n",
       "27.42 26.27 186.90 2501.0 0.10840 0.19880 0.36350 0.16890 0.2061 0.05623 2.5470 1.3060 18.650 542.20 0.007650 0.05374 0.080550 0.025980 0.01697 0.004558 36.04 31.37 251.20 4254.0 0.1357 0.42560 0.68330  0.2641   \n",
       "12.72 13.78 81.78  492.1  0.09667 0.08393 0.01288 0.01924 0.1638 0.06100 0.1807 0.6931 1.340  13.38  0.006064 0.01180 0.006564 0.007978 0.01374 0.001392 13.50 17.48 88.54  553.7  0.1298 0.14720 0.05233  0.2369   \n",
       "...                                                                                                                                                                                                           ...   \n",
       "20.20 26.83 133.70 1234.0 0.09905 0.16690 0.16410 0.12650 0.1875 0.06020 0.9761 1.8920 7.128  103.60 0.008439 0.04674 0.059040 0.025360 0.03710 0.004286 24.19 33.81 160.00 1671.0 0.1278 0.34160 0.37030  0.3271   \n",
       "16.46 20.11 109.30 832.9  0.09831 0.15560 0.17930 0.08866 0.1794 0.06323 0.3037 1.2840 2.482  31.59  0.006627 0.04094 0.053710 0.018130 0.01682 0.004584 17.79 28.45 123.50 981.2  0.1415 0.46670 0.58620  0.3054   \n",
       "13.81 23.75 91.56  597.8  0.13230 0.17680 0.15580 0.09176 0.2251 0.07421 0.5648 1.9300 3.909  52.72  0.008824 0.03108 0.031120 0.012910 0.01998 0.004506 19.20 41.85 128.50 1153.0 0.2226 0.52090 0.46460  0.4432   \n",
       "12.18 17.84 77.79  451.1  0.10450 0.07057 0.02490 0.02941 0.1900 0.06635 0.3661 1.5110 2.410  24.44  0.005433 0.01179 0.011310 0.015190 0.02220 0.003408 12.83 20.92 82.14  495.2  0.1140 0.09358 0.04980  0.2227   \n",
       "11.28 13.39 73.00  384.8  0.11640 0.11360 0.04635 0.04796 0.1771 0.06072 0.3384 1.3430 1.851  26.33  0.011270 0.03498 0.021870 0.019650 0.01580 0.003442 11.92 15.77 76.53  434.0  0.1367 0.18220 0.08669  0.2102   \n",
       "\n",
       "                                                                                                                                                                                                           malignant  \n",
       "20.47 20.67 134.70 1299.0 0.09156 0.13130 0.15230 0.10150 0.2166 0.05419 0.8336 1.7360 5.168  100.40 0.004938 0.03089 0.040930 0.016990 0.02816 0.002719 23.23 27.15 152.00 1645.0 0.1097 0.25340 0.30920    0.06386  \n",
       "11.74 14.69 76.31  426.0  0.08099 0.09661 0.06726 0.02639 0.1499 0.06758 0.1924 0.6417 1.345  13.04  0.006982 0.03916 0.040170 0.015280 0.02260 0.006822 12.45 17.60 81.25  473.8  0.1073 0.27930 0.26900    0.09879  \n",
       "13.47 14.06 87.32  546.3  0.10710 0.11550 0.05786 0.05266 0.1779 0.06639 0.1588 0.5733 1.102  12.84  0.004450 0.01452 0.013340 0.008791 0.01698 0.002787 14.83 18.32 94.94  660.2  0.1393 0.24990 0.18480    0.09326  \n",
       "27.42 26.27 186.90 2501.0 0.10840 0.19880 0.36350 0.16890 0.2061 0.05623 2.5470 1.3060 18.650 542.20 0.007650 0.05374 0.080550 0.025980 0.01697 0.004558 36.04 31.37 251.20 4254.0 0.1357 0.42560 0.68330    0.07427  \n",
       "12.72 13.78 81.78  492.1  0.09667 0.08393 0.01288 0.01924 0.1638 0.06100 0.1807 0.6931 1.340  13.38  0.006064 0.01180 0.006564 0.007978 0.01374 0.001392 13.50 17.48 88.54  553.7  0.1298 0.14720 0.05233    0.06922  \n",
       "...                                                                                                                                                                                                              ...  \n",
       "20.20 26.83 133.70 1234.0 0.09905 0.16690 0.16410 0.12650 0.1875 0.06020 0.9761 1.8920 7.128  103.60 0.008439 0.04674 0.059040 0.025360 0.03710 0.004286 24.19 33.81 160.00 1671.0 0.1278 0.34160 0.37030    0.07632  \n",
       "16.46 20.11 109.30 832.9  0.09831 0.15560 0.17930 0.08866 0.1794 0.06323 0.3037 1.2840 2.482  31.59  0.006627 0.04094 0.053710 0.018130 0.01682 0.004584 17.79 28.45 123.50 981.2  0.1415 0.46670 0.58620    0.09519  \n",
       "13.81 23.75 91.56  597.8  0.13230 0.17680 0.15580 0.09176 0.2251 0.07421 0.5648 1.9300 3.909  52.72  0.008824 0.03108 0.031120 0.012910 0.01998 0.004506 19.20 41.85 128.50 1153.0 0.2226 0.52090 0.46460    0.10860  \n",
       "12.18 17.84 77.79  451.1  0.10450 0.07057 0.02490 0.02941 0.1900 0.06635 0.3661 1.5110 2.410  24.44  0.005433 0.01179 0.011310 0.015190 0.02220 0.003408 12.83 20.92 82.14  495.2  0.1140 0.09358 0.04980    0.07376  \n",
       "11.28 13.39 73.00  384.8  0.11640 0.11360 0.04635 0.04796 0.1771 0.06072 0.3384 1.3430 1.851  26.33  0.011270 0.03498 0.021870 0.019650 0.01580 0.003442 11.92 15.77 76.53  434.0  0.1367 0.18220 0.08669    0.06784  \n",
       "\n",
       "[114 rows x 3 columns]"
      ]
     },
     "execution_count": 76,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# split data into train and test sets\n",
    "X_train, X_test, y_train, y_test = train_test_split(\n",
    "    X, y, test_size=0.2, stratify=y)\n",
    "X_test\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 77,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "pandas.core.series.Series"
      ]
     },
     "execution_count": 77,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "type(y_test)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 78,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th>569</th>\n",
       "      <th>30</th>\n",
       "      <th>malignant</th>\n",
       "      <th>benign</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>14.81</th>\n",
       "      <th>14.70</th>\n",
       "      <th>94.66</th>\n",
       "      <th>680.7</th>\n",
       "      <th>0.08472</th>\n",
       "      <th>0.05016</th>\n",
       "      <th>0.034160</th>\n",
       "      <th>0.025410</th>\n",
       "      <th>0.1659</th>\n",
       "      <th>0.05348</th>\n",
       "      <th>0.2182</th>\n",
       "      <th>0.6232</th>\n",
       "      <th>1.677</th>\n",
       "      <th>20.72</th>\n",
       "      <th>0.006708</th>\n",
       "      <th>0.011970</th>\n",
       "      <th>0.014820</th>\n",
       "      <th>0.010560</th>\n",
       "      <th>0.01580</th>\n",
       "      <th>0.001779</th>\n",
       "      <th>15.61</th>\n",
       "      <th>17.58</th>\n",
       "      <th>101.70</th>\n",
       "      <th>760.2</th>\n",
       "      <th>0.1139</th>\n",
       "      <th>0.10110</th>\n",
       "      <th>0.110100</th>\n",
       "      <td>0.07955</td>\n",
       "      <td>0.2334</td>\n",
       "      <td>0.06142</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11.71</th>\n",
       "      <th>16.67</th>\n",
       "      <th>74.72</th>\n",
       "      <th>423.6</th>\n",
       "      <th>0.10510</th>\n",
       "      <th>0.06095</th>\n",
       "      <th>0.035920</th>\n",
       "      <th>0.026000</th>\n",
       "      <th>0.1339</th>\n",
       "      <th>0.05945</th>\n",
       "      <th>0.4489</th>\n",
       "      <th>2.5080</th>\n",
       "      <th>3.258</th>\n",
       "      <th>34.37</th>\n",
       "      <th>0.006578</th>\n",
       "      <th>0.013800</th>\n",
       "      <th>0.026620</th>\n",
       "      <th>0.013070</th>\n",
       "      <th>0.01359</th>\n",
       "      <th>0.003707</th>\n",
       "      <th>13.33</th>\n",
       "      <th>25.48</th>\n",
       "      <th>86.16</th>\n",
       "      <th>546.7</th>\n",
       "      <th>0.1271</th>\n",
       "      <th>0.10280</th>\n",
       "      <th>0.104600</th>\n",
       "      <td>0.06968</td>\n",
       "      <td>0.1712</td>\n",
       "      <td>0.07343</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13.77</th>\n",
       "      <th>13.27</th>\n",
       "      <th>88.06</th>\n",
       "      <th>582.7</th>\n",
       "      <th>0.09198</th>\n",
       "      <th>0.06221</th>\n",
       "      <th>0.010630</th>\n",
       "      <th>0.019170</th>\n",
       "      <th>0.1592</th>\n",
       "      <th>0.05912</th>\n",
       "      <th>0.2191</th>\n",
       "      <th>0.6946</th>\n",
       "      <th>1.479</th>\n",
       "      <th>17.74</th>\n",
       "      <th>0.004348</th>\n",
       "      <th>0.008153</th>\n",
       "      <th>0.004272</th>\n",
       "      <th>0.006829</th>\n",
       "      <th>0.02154</th>\n",
       "      <th>0.001802</th>\n",
       "      <th>14.67</th>\n",
       "      <th>16.93</th>\n",
       "      <th>94.17</th>\n",
       "      <th>661.1</th>\n",
       "      <th>0.1170</th>\n",
       "      <th>0.10720</th>\n",
       "      <th>0.037320</th>\n",
       "      <td>0.05802</td>\n",
       "      <td>0.2823</td>\n",
       "      <td>0.06794</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13.05</th>\n",
       "      <th>19.31</th>\n",
       "      <th>82.61</th>\n",
       "      <th>527.2</th>\n",
       "      <th>0.08060</th>\n",
       "      <th>0.03789</th>\n",
       "      <th>0.000692</th>\n",
       "      <th>0.004167</th>\n",
       "      <th>0.1819</th>\n",
       "      <th>0.05501</th>\n",
       "      <th>0.4040</th>\n",
       "      <th>1.2140</th>\n",
       "      <th>2.595</th>\n",
       "      <th>32.96</th>\n",
       "      <th>0.007491</th>\n",
       "      <th>0.008593</th>\n",
       "      <th>0.000692</th>\n",
       "      <th>0.004167</th>\n",
       "      <th>0.02190</th>\n",
       "      <th>0.002990</th>\n",
       "      <th>14.23</th>\n",
       "      <th>22.25</th>\n",
       "      <th>90.24</th>\n",
       "      <th>624.1</th>\n",
       "      <th>0.1021</th>\n",
       "      <th>0.06191</th>\n",
       "      <th>0.001845</th>\n",
       "      <td>0.01111</td>\n",
       "      <td>0.2439</td>\n",
       "      <td>0.06289</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19.53</th>\n",
       "      <th>18.90</th>\n",
       "      <th>129.50</th>\n",
       "      <th>1217.0</th>\n",
       "      <th>0.11500</th>\n",
       "      <th>0.16420</th>\n",
       "      <th>0.219700</th>\n",
       "      <th>0.106200</th>\n",
       "      <th>0.1792</th>\n",
       "      <th>0.06552</th>\n",
       "      <th>1.1110</th>\n",
       "      <th>1.1610</th>\n",
       "      <th>7.237</th>\n",
       "      <th>133.00</th>\n",
       "      <th>0.006056</th>\n",
       "      <th>0.032030</th>\n",
       "      <th>0.056380</th>\n",
       "      <th>0.017330</th>\n",
       "      <th>0.01884</th>\n",
       "      <th>0.004787</th>\n",
       "      <th>25.93</th>\n",
       "      <th>26.24</th>\n",
       "      <th>171.10</th>\n",
       "      <th>2053.0</th>\n",
       "      <th>0.1495</th>\n",
       "      <th>0.41160</th>\n",
       "      <th>0.612100</th>\n",
       "      <td>0.19800</td>\n",
       "      <td>0.2968</td>\n",
       "      <td>0.09929</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13.46</th>\n",
       "      <th>18.75</th>\n",
       "      <th>87.44</th>\n",
       "      <th>551.1</th>\n",
       "      <th>0.10750</th>\n",
       "      <th>0.11380</th>\n",
       "      <th>0.042010</th>\n",
       "      <th>0.031520</th>\n",
       "      <th>0.1723</th>\n",
       "      <th>0.06317</th>\n",
       "      <th>0.1998</th>\n",
       "      <th>0.6068</th>\n",
       "      <th>1.443</th>\n",
       "      <th>16.07</th>\n",
       "      <th>0.004413</th>\n",
       "      <th>0.014430</th>\n",
       "      <th>0.015090</th>\n",
       "      <th>0.007369</th>\n",
       "      <th>0.01354</th>\n",
       "      <th>0.001787</th>\n",
       "      <th>15.35</th>\n",
       "      <th>25.16</th>\n",
       "      <th>101.90</th>\n",
       "      <th>719.8</th>\n",
       "      <th>0.1624</th>\n",
       "      <th>0.31240</th>\n",
       "      <th>0.265400</th>\n",
       "      <td>0.14270</td>\n",
       "      <td>0.3518</td>\n",
       "      <td>0.08665</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18.45</th>\n",
       "      <th>21.91</th>\n",
       "      <th>120.20</th>\n",
       "      <th>1075.0</th>\n",
       "      <th>0.09430</th>\n",
       "      <th>0.09709</th>\n",
       "      <th>0.115300</th>\n",
       "      <th>0.068470</th>\n",
       "      <th>0.1692</th>\n",
       "      <th>0.05727</th>\n",
       "      <th>0.5959</th>\n",
       "      <th>1.2020</th>\n",
       "      <th>3.766</th>\n",
       "      <th>68.35</th>\n",
       "      <th>0.006001</th>\n",
       "      <th>0.014220</th>\n",
       "      <th>0.028550</th>\n",
       "      <th>0.009148</th>\n",
       "      <th>0.01492</th>\n",
       "      <th>0.002205</th>\n",
       "      <th>22.52</th>\n",
       "      <th>31.39</th>\n",
       "      <th>145.60</th>\n",
       "      <th>1590.0</th>\n",
       "      <th>0.1465</th>\n",
       "      <th>0.22750</th>\n",
       "      <th>0.396500</th>\n",
       "      <td>0.13790</td>\n",
       "      <td>0.3109</td>\n",
       "      <td>0.07610</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11.25</th>\n",
       "      <th>14.78</th>\n",
       "      <th>71.38</th>\n",
       "      <th>390.0</th>\n",
       "      <th>0.08306</th>\n",
       "      <th>0.04458</th>\n",
       "      <th>0.000974</th>\n",
       "      <th>0.002941</th>\n",
       "      <th>0.1773</th>\n",
       "      <th>0.06081</th>\n",
       "      <th>0.2144</th>\n",
       "      <th>0.9961</th>\n",
       "      <th>1.529</th>\n",
       "      <th>15.07</th>\n",
       "      <th>0.005617</th>\n",
       "      <th>0.007124</th>\n",
       "      <th>0.000974</th>\n",
       "      <th>0.002941</th>\n",
       "      <th>0.01700</th>\n",
       "      <th>0.002030</th>\n",
       "      <th>12.76</th>\n",
       "      <th>22.06</th>\n",
       "      <th>82.08</th>\n",
       "      <th>492.7</th>\n",
       "      <th>0.1166</th>\n",
       "      <th>0.09794</th>\n",
       "      <th>0.005518</th>\n",
       "      <td>0.01667</td>\n",
       "      <td>0.2815</td>\n",
       "      <td>0.07418</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11.71</th>\n",
       "      <th>15.45</th>\n",
       "      <th>75.03</th>\n",
       "      <th>420.3</th>\n",
       "      <th>0.11500</th>\n",
       "      <th>0.07281</th>\n",
       "      <th>0.040060</th>\n",
       "      <th>0.032500</th>\n",
       "      <th>0.2009</th>\n",
       "      <th>0.06506</th>\n",
       "      <th>0.3446</th>\n",
       "      <th>0.7395</th>\n",
       "      <th>2.355</th>\n",
       "      <th>24.53</th>\n",
       "      <th>0.009536</th>\n",
       "      <th>0.010970</th>\n",
       "      <th>0.016510</th>\n",
       "      <th>0.011210</th>\n",
       "      <th>0.01953</th>\n",
       "      <th>0.003100</th>\n",
       "      <th>13.06</th>\n",
       "      <th>18.16</th>\n",
       "      <th>84.16</th>\n",
       "      <th>516.4</th>\n",
       "      <th>0.1460</th>\n",
       "      <th>0.11150</th>\n",
       "      <th>0.108700</th>\n",
       "      <td>0.07864</td>\n",
       "      <td>0.2765</td>\n",
       "      <td>0.07806</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11.74</th>\n",
       "      <th>14.02</th>\n",
       "      <th>74.24</th>\n",
       "      <th>427.3</th>\n",
       "      <th>0.07813</th>\n",
       "      <th>0.04340</th>\n",
       "      <th>0.022450</th>\n",
       "      <th>0.027630</th>\n",
       "      <th>0.2101</th>\n",
       "      <th>0.06113</th>\n",
       "      <th>0.5619</th>\n",
       "      <th>1.2680</th>\n",
       "      <th>3.717</th>\n",
       "      <th>37.83</th>\n",
       "      <th>0.008034</th>\n",
       "      <th>0.014420</th>\n",
       "      <th>0.015140</th>\n",
       "      <th>0.018460</th>\n",
       "      <th>0.02921</th>\n",
       "      <th>0.002005</th>\n",
       "      <th>13.31</th>\n",
       "      <th>18.26</th>\n",
       "      <th>84.70</th>\n",
       "      <th>533.7</th>\n",
       "      <th>0.1036</th>\n",
       "      <th>0.08500</th>\n",
       "      <th>0.067350</th>\n",
       "      <td>0.08290</td>\n",
       "      <td>0.3101</td>\n",
       "      <td>0.06688</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>455 rows × 4 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                                                                                                                                                                                                                  569  \\\n",
       "14.81 14.70 94.66  680.7  0.08472 0.05016 0.034160 0.025410 0.1659 0.05348 0.2182 0.6232 1.677 20.72  0.006708 0.011970 0.014820 0.010560 0.01580 0.001779 15.61 17.58 101.70 760.2  0.1139 0.10110 0.110100  0.07955   \n",
       "11.71 16.67 74.72  423.6  0.10510 0.06095 0.035920 0.026000 0.1339 0.05945 0.4489 2.5080 3.258 34.37  0.006578 0.013800 0.026620 0.013070 0.01359 0.003707 13.33 25.48 86.16  546.7  0.1271 0.10280 0.104600  0.06968   \n",
       "13.77 13.27 88.06  582.7  0.09198 0.06221 0.010630 0.019170 0.1592 0.05912 0.2191 0.6946 1.479 17.74  0.004348 0.008153 0.004272 0.006829 0.02154 0.001802 14.67 16.93 94.17  661.1  0.1170 0.10720 0.037320  0.05802   \n",
       "13.05 19.31 82.61  527.2  0.08060 0.03789 0.000692 0.004167 0.1819 0.05501 0.4040 1.2140 2.595 32.96  0.007491 0.008593 0.000692 0.004167 0.02190 0.002990 14.23 22.25 90.24  624.1  0.1021 0.06191 0.001845  0.01111   \n",
       "19.53 18.90 129.50 1217.0 0.11500 0.16420 0.219700 0.106200 0.1792 0.06552 1.1110 1.1610 7.237 133.00 0.006056 0.032030 0.056380 0.017330 0.01884 0.004787 25.93 26.24 171.10 2053.0 0.1495 0.41160 0.612100  0.19800   \n",
       "...                                                                                                                                                                                                               ...   \n",
       "13.46 18.75 87.44  551.1  0.10750 0.11380 0.042010 0.031520 0.1723 0.06317 0.1998 0.6068 1.443 16.07  0.004413 0.014430 0.015090 0.007369 0.01354 0.001787 15.35 25.16 101.90 719.8  0.1624 0.31240 0.265400  0.14270   \n",
       "18.45 21.91 120.20 1075.0 0.09430 0.09709 0.115300 0.068470 0.1692 0.05727 0.5959 1.2020 3.766 68.35  0.006001 0.014220 0.028550 0.009148 0.01492 0.002205 22.52 31.39 145.60 1590.0 0.1465 0.22750 0.396500  0.13790   \n",
       "11.25 14.78 71.38  390.0  0.08306 0.04458 0.000974 0.002941 0.1773 0.06081 0.2144 0.9961 1.529 15.07  0.005617 0.007124 0.000974 0.002941 0.01700 0.002030 12.76 22.06 82.08  492.7  0.1166 0.09794 0.005518  0.01667   \n",
       "11.71 15.45 75.03  420.3  0.11500 0.07281 0.040060 0.032500 0.2009 0.06506 0.3446 0.7395 2.355 24.53  0.009536 0.010970 0.016510 0.011210 0.01953 0.003100 13.06 18.16 84.16  516.4  0.1460 0.11150 0.108700  0.07864   \n",
       "11.74 14.02 74.24  427.3  0.07813 0.04340 0.022450 0.027630 0.2101 0.06113 0.5619 1.2680 3.717 37.83  0.008034 0.014420 0.015140 0.018460 0.02921 0.002005 13.31 18.26 84.70  533.7  0.1036 0.08500 0.067350  0.08290   \n",
       "\n",
       "                                                                                                                                                                                                                  30  \\\n",
       "14.81 14.70 94.66  680.7  0.08472 0.05016 0.034160 0.025410 0.1659 0.05348 0.2182 0.6232 1.677 20.72  0.006708 0.011970 0.014820 0.010560 0.01580 0.001779 15.61 17.58 101.70 760.2  0.1139 0.10110 0.110100  0.2334   \n",
       "11.71 16.67 74.72  423.6  0.10510 0.06095 0.035920 0.026000 0.1339 0.05945 0.4489 2.5080 3.258 34.37  0.006578 0.013800 0.026620 0.013070 0.01359 0.003707 13.33 25.48 86.16  546.7  0.1271 0.10280 0.104600  0.1712   \n",
       "13.77 13.27 88.06  582.7  0.09198 0.06221 0.010630 0.019170 0.1592 0.05912 0.2191 0.6946 1.479 17.74  0.004348 0.008153 0.004272 0.006829 0.02154 0.001802 14.67 16.93 94.17  661.1  0.1170 0.10720 0.037320  0.2823   \n",
       "13.05 19.31 82.61  527.2  0.08060 0.03789 0.000692 0.004167 0.1819 0.05501 0.4040 1.2140 2.595 32.96  0.007491 0.008593 0.000692 0.004167 0.02190 0.002990 14.23 22.25 90.24  624.1  0.1021 0.06191 0.001845  0.2439   \n",
       "19.53 18.90 129.50 1217.0 0.11500 0.16420 0.219700 0.106200 0.1792 0.06552 1.1110 1.1610 7.237 133.00 0.006056 0.032030 0.056380 0.017330 0.01884 0.004787 25.93 26.24 171.10 2053.0 0.1495 0.41160 0.612100  0.2968   \n",
       "...                                                                                                                                                                                                              ...   \n",
       "13.46 18.75 87.44  551.1  0.10750 0.11380 0.042010 0.031520 0.1723 0.06317 0.1998 0.6068 1.443 16.07  0.004413 0.014430 0.015090 0.007369 0.01354 0.001787 15.35 25.16 101.90 719.8  0.1624 0.31240 0.265400  0.3518   \n",
       "18.45 21.91 120.20 1075.0 0.09430 0.09709 0.115300 0.068470 0.1692 0.05727 0.5959 1.2020 3.766 68.35  0.006001 0.014220 0.028550 0.009148 0.01492 0.002205 22.52 31.39 145.60 1590.0 0.1465 0.22750 0.396500  0.3109   \n",
       "11.25 14.78 71.38  390.0  0.08306 0.04458 0.000974 0.002941 0.1773 0.06081 0.2144 0.9961 1.529 15.07  0.005617 0.007124 0.000974 0.002941 0.01700 0.002030 12.76 22.06 82.08  492.7  0.1166 0.09794 0.005518  0.2815   \n",
       "11.71 15.45 75.03  420.3  0.11500 0.07281 0.040060 0.032500 0.2009 0.06506 0.3446 0.7395 2.355 24.53  0.009536 0.010970 0.016510 0.011210 0.01953 0.003100 13.06 18.16 84.16  516.4  0.1460 0.11150 0.108700  0.2765   \n",
       "11.74 14.02 74.24  427.3  0.07813 0.04340 0.022450 0.027630 0.2101 0.06113 0.5619 1.2680 3.717 37.83  0.008034 0.014420 0.015140 0.018460 0.02921 0.002005 13.31 18.26 84.70  533.7  0.1036 0.08500 0.067350  0.3101   \n",
       "\n",
       "                                                                                                                                                                                                              malignant  \\\n",
       "14.81 14.70 94.66  680.7  0.08472 0.05016 0.034160 0.025410 0.1659 0.05348 0.2182 0.6232 1.677 20.72  0.006708 0.011970 0.014820 0.010560 0.01580 0.001779 15.61 17.58 101.70 760.2  0.1139 0.10110 0.110100    0.06142   \n",
       "11.71 16.67 74.72  423.6  0.10510 0.06095 0.035920 0.026000 0.1339 0.05945 0.4489 2.5080 3.258 34.37  0.006578 0.013800 0.026620 0.013070 0.01359 0.003707 13.33 25.48 86.16  546.7  0.1271 0.10280 0.104600    0.07343   \n",
       "13.77 13.27 88.06  582.7  0.09198 0.06221 0.010630 0.019170 0.1592 0.05912 0.2191 0.6946 1.479 17.74  0.004348 0.008153 0.004272 0.006829 0.02154 0.001802 14.67 16.93 94.17  661.1  0.1170 0.10720 0.037320    0.06794   \n",
       "13.05 19.31 82.61  527.2  0.08060 0.03789 0.000692 0.004167 0.1819 0.05501 0.4040 1.2140 2.595 32.96  0.007491 0.008593 0.000692 0.004167 0.02190 0.002990 14.23 22.25 90.24  624.1  0.1021 0.06191 0.001845    0.06289   \n",
       "19.53 18.90 129.50 1217.0 0.11500 0.16420 0.219700 0.106200 0.1792 0.06552 1.1110 1.1610 7.237 133.00 0.006056 0.032030 0.056380 0.017330 0.01884 0.004787 25.93 26.24 171.10 2053.0 0.1495 0.41160 0.612100    0.09929   \n",
       "...                                                                                                                                                                                                                 ...   \n",
       "13.46 18.75 87.44  551.1  0.10750 0.11380 0.042010 0.031520 0.1723 0.06317 0.1998 0.6068 1.443 16.07  0.004413 0.014430 0.015090 0.007369 0.01354 0.001787 15.35 25.16 101.90 719.8  0.1624 0.31240 0.265400    0.08665   \n",
       "18.45 21.91 120.20 1075.0 0.09430 0.09709 0.115300 0.068470 0.1692 0.05727 0.5959 1.2020 3.766 68.35  0.006001 0.014220 0.028550 0.009148 0.01492 0.002205 22.52 31.39 145.60 1590.0 0.1465 0.22750 0.396500    0.07610   \n",
       "11.25 14.78 71.38  390.0  0.08306 0.04458 0.000974 0.002941 0.1773 0.06081 0.2144 0.9961 1.529 15.07  0.005617 0.007124 0.000974 0.002941 0.01700 0.002030 12.76 22.06 82.08  492.7  0.1166 0.09794 0.005518    0.07418   \n",
       "11.71 15.45 75.03  420.3  0.11500 0.07281 0.040060 0.032500 0.2009 0.06506 0.3446 0.7395 2.355 24.53  0.009536 0.010970 0.016510 0.011210 0.01953 0.003100 13.06 18.16 84.16  516.4  0.1460 0.11150 0.108700    0.07806   \n",
       "11.74 14.02 74.24  427.3  0.07813 0.04340 0.022450 0.027630 0.2101 0.06113 0.5619 1.2680 3.717 37.83  0.008034 0.014420 0.015140 0.018460 0.02921 0.002005 13.31 18.26 84.70  533.7  0.1036 0.08500 0.067350    0.06688   \n",
       "\n",
       "                                                                                                                                                                                                              benign  \n",
       "14.81 14.70 94.66  680.7  0.08472 0.05016 0.034160 0.025410 0.1659 0.05348 0.2182 0.6232 1.677 20.72  0.006708 0.011970 0.014820 0.010560 0.01580 0.001779 15.61 17.58 101.70 760.2  0.1139 0.10110 0.110100       1  \n",
       "11.71 16.67 74.72  423.6  0.10510 0.06095 0.035920 0.026000 0.1339 0.05945 0.4489 2.5080 3.258 34.37  0.006578 0.013800 0.026620 0.013070 0.01359 0.003707 13.33 25.48 86.16  546.7  0.1271 0.10280 0.104600       1  \n",
       "13.77 13.27 88.06  582.7  0.09198 0.06221 0.010630 0.019170 0.1592 0.05912 0.2191 0.6946 1.479 17.74  0.004348 0.008153 0.004272 0.006829 0.02154 0.001802 14.67 16.93 94.17  661.1  0.1170 0.10720 0.037320       1  \n",
       "13.05 19.31 82.61  527.2  0.08060 0.03789 0.000692 0.004167 0.1819 0.05501 0.4040 1.2140 2.595 32.96  0.007491 0.008593 0.000692 0.004167 0.02190 0.002990 14.23 22.25 90.24  624.1  0.1021 0.06191 0.001845       1  \n",
       "19.53 18.90 129.50 1217.0 0.11500 0.16420 0.219700 0.106200 0.1792 0.06552 1.1110 1.1610 7.237 133.00 0.006056 0.032030 0.056380 0.017330 0.01884 0.004787 25.93 26.24 171.10 2053.0 0.1495 0.41160 0.612100       0  \n",
       "...                                                                                                                                                                                                              ...  \n",
       "13.46 18.75 87.44  551.1  0.10750 0.11380 0.042010 0.031520 0.1723 0.06317 0.1998 0.6068 1.443 16.07  0.004413 0.014430 0.015090 0.007369 0.01354 0.001787 15.35 25.16 101.90 719.8  0.1624 0.31240 0.265400       1  \n",
       "18.45 21.91 120.20 1075.0 0.09430 0.09709 0.115300 0.068470 0.1692 0.05727 0.5959 1.2020 3.766 68.35  0.006001 0.014220 0.028550 0.009148 0.01492 0.002205 22.52 31.39 145.60 1590.0 0.1465 0.22750 0.396500       0  \n",
       "11.25 14.78 71.38  390.0  0.08306 0.04458 0.000974 0.002941 0.1773 0.06081 0.2144 0.9961 1.529 15.07  0.005617 0.007124 0.000974 0.002941 0.01700 0.002030 12.76 22.06 82.08  492.7  0.1166 0.09794 0.005518       1  \n",
       "11.71 15.45 75.03  420.3  0.11500 0.07281 0.040060 0.032500 0.2009 0.06506 0.3446 0.7395 2.355 24.53  0.009536 0.010970 0.016510 0.011210 0.01953 0.003100 13.06 18.16 84.16  516.4  0.1460 0.11150 0.108700       1  \n",
       "11.74 14.02 74.24  427.3  0.07813 0.04340 0.022450 0.027630 0.2101 0.06113 0.5619 1.2680 3.717 37.83  0.008034 0.014420 0.015140 0.018460 0.02921 0.002005 13.31 18.26 84.70  533.7  0.1036 0.08500 0.067350       1  \n",
       "\n",
       "[455 rows x 4 columns]"
      ]
     },
     "execution_count": 78,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 合并 X_train 和 y_train\n",
    "X_y_train = X_train.copy()\n",
    "X_y_train.insert(loc=len(X_y_train.columns), column='benign', value=y_train)\n",
    "X_y_train"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 79,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th>569</th>\n",
       "      <th>30</th>\n",
       "      <th>malignant</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>14.81</th>\n",
       "      <th>14.70</th>\n",
       "      <th>94.66</th>\n",
       "      <th>680.7</th>\n",
       "      <th>0.08472</th>\n",
       "      <th>0.05016</th>\n",
       "      <th>0.034160</th>\n",
       "      <th>0.025410</th>\n",
       "      <th>0.1659</th>\n",
       "      <th>0.05348</th>\n",
       "      <th>0.2182</th>\n",
       "      <th>0.6232</th>\n",
       "      <th>1.677</th>\n",
       "      <th>20.72</th>\n",
       "      <th>0.006708</th>\n",
       "      <th>0.011970</th>\n",
       "      <th>0.014820</th>\n",
       "      <th>0.010560</th>\n",
       "      <th>0.01580</th>\n",
       "      <th>0.001779</th>\n",
       "      <th>15.61</th>\n",
       "      <th>17.58</th>\n",
       "      <th>101.70</th>\n",
       "      <th>760.2</th>\n",
       "      <th>0.1139</th>\n",
       "      <th>0.10110</th>\n",
       "      <th>0.110100</th>\n",
       "      <td>0.07955</td>\n",
       "      <td>0.2334</td>\n",
       "      <td>0.06142</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11.71</th>\n",
       "      <th>16.67</th>\n",
       "      <th>74.72</th>\n",
       "      <th>423.6</th>\n",
       "      <th>0.10510</th>\n",
       "      <th>0.06095</th>\n",
       "      <th>0.035920</th>\n",
       "      <th>0.026000</th>\n",
       "      <th>0.1339</th>\n",
       "      <th>0.05945</th>\n",
       "      <th>0.4489</th>\n",
       "      <th>2.5080</th>\n",
       "      <th>3.258</th>\n",
       "      <th>34.37</th>\n",
       "      <th>0.006578</th>\n",
       "      <th>0.013800</th>\n",
       "      <th>0.026620</th>\n",
       "      <th>0.013070</th>\n",
       "      <th>0.01359</th>\n",
       "      <th>0.003707</th>\n",
       "      <th>13.33</th>\n",
       "      <th>25.48</th>\n",
       "      <th>86.16</th>\n",
       "      <th>546.7</th>\n",
       "      <th>0.1271</th>\n",
       "      <th>0.10280</th>\n",
       "      <th>0.104600</th>\n",
       "      <td>0.06968</td>\n",
       "      <td>0.1712</td>\n",
       "      <td>0.07343</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13.77</th>\n",
       "      <th>13.27</th>\n",
       "      <th>88.06</th>\n",
       "      <th>582.7</th>\n",
       "      <th>0.09198</th>\n",
       "      <th>0.06221</th>\n",
       "      <th>0.010630</th>\n",
       "      <th>0.019170</th>\n",
       "      <th>0.1592</th>\n",
       "      <th>0.05912</th>\n",
       "      <th>0.2191</th>\n",
       "      <th>0.6946</th>\n",
       "      <th>1.479</th>\n",
       "      <th>17.74</th>\n",
       "      <th>0.004348</th>\n",
       "      <th>0.008153</th>\n",
       "      <th>0.004272</th>\n",
       "      <th>0.006829</th>\n",
       "      <th>0.02154</th>\n",
       "      <th>0.001802</th>\n",
       "      <th>14.67</th>\n",
       "      <th>16.93</th>\n",
       "      <th>94.17</th>\n",
       "      <th>661.1</th>\n",
       "      <th>0.1170</th>\n",
       "      <th>0.10720</th>\n",
       "      <th>0.037320</th>\n",
       "      <td>0.05802</td>\n",
       "      <td>0.2823</td>\n",
       "      <td>0.06794</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13.05</th>\n",
       "      <th>19.31</th>\n",
       "      <th>82.61</th>\n",
       "      <th>527.2</th>\n",
       "      <th>0.08060</th>\n",
       "      <th>0.03789</th>\n",
       "      <th>0.000692</th>\n",
       "      <th>0.004167</th>\n",
       "      <th>0.1819</th>\n",
       "      <th>0.05501</th>\n",
       "      <th>0.4040</th>\n",
       "      <th>1.2140</th>\n",
       "      <th>2.595</th>\n",
       "      <th>32.96</th>\n",
       "      <th>0.007491</th>\n",
       "      <th>0.008593</th>\n",
       "      <th>0.000692</th>\n",
       "      <th>0.004167</th>\n",
       "      <th>0.02190</th>\n",
       "      <th>0.002990</th>\n",
       "      <th>14.23</th>\n",
       "      <th>22.25</th>\n",
       "      <th>90.24</th>\n",
       "      <th>624.1</th>\n",
       "      <th>0.1021</th>\n",
       "      <th>0.06191</th>\n",
       "      <th>0.001845</th>\n",
       "      <td>0.01111</td>\n",
       "      <td>0.2439</td>\n",
       "      <td>0.06289</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19.53</th>\n",
       "      <th>18.90</th>\n",
       "      <th>129.50</th>\n",
       "      <th>1217.0</th>\n",
       "      <th>0.11500</th>\n",
       "      <th>0.16420</th>\n",
       "      <th>0.219700</th>\n",
       "      <th>0.106200</th>\n",
       "      <th>0.1792</th>\n",
       "      <th>0.06552</th>\n",
       "      <th>1.1110</th>\n",
       "      <th>1.1610</th>\n",
       "      <th>7.237</th>\n",
       "      <th>133.00</th>\n",
       "      <th>0.006056</th>\n",
       "      <th>0.032030</th>\n",
       "      <th>0.056380</th>\n",
       "      <th>0.017330</th>\n",
       "      <th>0.01884</th>\n",
       "      <th>0.004787</th>\n",
       "      <th>25.93</th>\n",
       "      <th>26.24</th>\n",
       "      <th>171.10</th>\n",
       "      <th>2053.0</th>\n",
       "      <th>0.1495</th>\n",
       "      <th>0.41160</th>\n",
       "      <th>0.612100</th>\n",
       "      <td>0.19800</td>\n",
       "      <td>0.2968</td>\n",
       "      <td>0.09929</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13.46</th>\n",
       "      <th>18.75</th>\n",
       "      <th>87.44</th>\n",
       "      <th>551.1</th>\n",
       "      <th>0.10750</th>\n",
       "      <th>0.11380</th>\n",
       "      <th>0.042010</th>\n",
       "      <th>0.031520</th>\n",
       "      <th>0.1723</th>\n",
       "      <th>0.06317</th>\n",
       "      <th>0.1998</th>\n",
       "      <th>0.6068</th>\n",
       "      <th>1.443</th>\n",
       "      <th>16.07</th>\n",
       "      <th>0.004413</th>\n",
       "      <th>0.014430</th>\n",
       "      <th>0.015090</th>\n",
       "      <th>0.007369</th>\n",
       "      <th>0.01354</th>\n",
       "      <th>0.001787</th>\n",
       "      <th>15.35</th>\n",
       "      <th>25.16</th>\n",
       "      <th>101.90</th>\n",
       "      <th>719.8</th>\n",
       "      <th>0.1624</th>\n",
       "      <th>0.31240</th>\n",
       "      <th>0.265400</th>\n",
       "      <td>0.14270</td>\n",
       "      <td>0.3518</td>\n",
       "      <td>0.08665</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18.45</th>\n",
       "      <th>21.91</th>\n",
       "      <th>120.20</th>\n",
       "      <th>1075.0</th>\n",
       "      <th>0.09430</th>\n",
       "      <th>0.09709</th>\n",
       "      <th>0.115300</th>\n",
       "      <th>0.068470</th>\n",
       "      <th>0.1692</th>\n",
       "      <th>0.05727</th>\n",
       "      <th>0.5959</th>\n",
       "      <th>1.2020</th>\n",
       "      <th>3.766</th>\n",
       "      <th>68.35</th>\n",
       "      <th>0.006001</th>\n",
       "      <th>0.014220</th>\n",
       "      <th>0.028550</th>\n",
       "      <th>0.009148</th>\n",
       "      <th>0.01492</th>\n",
       "      <th>0.002205</th>\n",
       "      <th>22.52</th>\n",
       "      <th>31.39</th>\n",
       "      <th>145.60</th>\n",
       "      <th>1590.0</th>\n",
       "      <th>0.1465</th>\n",
       "      <th>0.22750</th>\n",
       "      <th>0.396500</th>\n",
       "      <td>0.13790</td>\n",
       "      <td>0.3109</td>\n",
       "      <td>0.07610</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11.25</th>\n",
       "      <th>14.78</th>\n",
       "      <th>71.38</th>\n",
       "      <th>390.0</th>\n",
       "      <th>0.08306</th>\n",
       "      <th>0.04458</th>\n",
       "      <th>0.000974</th>\n",
       "      <th>0.002941</th>\n",
       "      <th>0.1773</th>\n",
       "      <th>0.06081</th>\n",
       "      <th>0.2144</th>\n",
       "      <th>0.9961</th>\n",
       "      <th>1.529</th>\n",
       "      <th>15.07</th>\n",
       "      <th>0.005617</th>\n",
       "      <th>0.007124</th>\n",
       "      <th>0.000974</th>\n",
       "      <th>0.002941</th>\n",
       "      <th>0.01700</th>\n",
       "      <th>0.002030</th>\n",
       "      <th>12.76</th>\n",
       "      <th>22.06</th>\n",
       "      <th>82.08</th>\n",
       "      <th>492.7</th>\n",
       "      <th>0.1166</th>\n",
       "      <th>0.09794</th>\n",
       "      <th>0.005518</th>\n",
       "      <td>0.01667</td>\n",
       "      <td>0.2815</td>\n",
       "      <td>0.07418</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11.71</th>\n",
       "      <th>15.45</th>\n",
       "      <th>75.03</th>\n",
       "      <th>420.3</th>\n",
       "      <th>0.11500</th>\n",
       "      <th>0.07281</th>\n",
       "      <th>0.040060</th>\n",
       "      <th>0.032500</th>\n",
       "      <th>0.2009</th>\n",
       "      <th>0.06506</th>\n",
       "      <th>0.3446</th>\n",
       "      <th>0.7395</th>\n",
       "      <th>2.355</th>\n",
       "      <th>24.53</th>\n",
       "      <th>0.009536</th>\n",
       "      <th>0.010970</th>\n",
       "      <th>0.016510</th>\n",
       "      <th>0.011210</th>\n",
       "      <th>0.01953</th>\n",
       "      <th>0.003100</th>\n",
       "      <th>13.06</th>\n",
       "      <th>18.16</th>\n",
       "      <th>84.16</th>\n",
       "      <th>516.4</th>\n",
       "      <th>0.1460</th>\n",
       "      <th>0.11150</th>\n",
       "      <th>0.108700</th>\n",
       "      <td>0.07864</td>\n",
       "      <td>0.2765</td>\n",
       "      <td>0.07806</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11.74</th>\n",
       "      <th>14.02</th>\n",
       "      <th>74.24</th>\n",
       "      <th>427.3</th>\n",
       "      <th>0.07813</th>\n",
       "      <th>0.04340</th>\n",
       "      <th>0.022450</th>\n",
       "      <th>0.027630</th>\n",
       "      <th>0.2101</th>\n",
       "      <th>0.06113</th>\n",
       "      <th>0.5619</th>\n",
       "      <th>1.2680</th>\n",
       "      <th>3.717</th>\n",
       "      <th>37.83</th>\n",
       "      <th>0.008034</th>\n",
       "      <th>0.014420</th>\n",
       "      <th>0.015140</th>\n",
       "      <th>0.018460</th>\n",
       "      <th>0.02921</th>\n",
       "      <th>0.002005</th>\n",
       "      <th>13.31</th>\n",
       "      <th>18.26</th>\n",
       "      <th>84.70</th>\n",
       "      <th>533.7</th>\n",
       "      <th>0.1036</th>\n",
       "      <th>0.08500</th>\n",
       "      <th>0.067350</th>\n",
       "      <td>0.08290</td>\n",
       "      <td>0.3101</td>\n",
       "      <td>0.06688</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>455 rows × 3 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                                                                                                                                                                                                                  569  \\\n",
       "14.81 14.70 94.66  680.7  0.08472 0.05016 0.034160 0.025410 0.1659 0.05348 0.2182 0.6232 1.677 20.72  0.006708 0.011970 0.014820 0.010560 0.01580 0.001779 15.61 17.58 101.70 760.2  0.1139 0.10110 0.110100  0.07955   \n",
       "11.71 16.67 74.72  423.6  0.10510 0.06095 0.035920 0.026000 0.1339 0.05945 0.4489 2.5080 3.258 34.37  0.006578 0.013800 0.026620 0.013070 0.01359 0.003707 13.33 25.48 86.16  546.7  0.1271 0.10280 0.104600  0.06968   \n",
       "13.77 13.27 88.06  582.7  0.09198 0.06221 0.010630 0.019170 0.1592 0.05912 0.2191 0.6946 1.479 17.74  0.004348 0.008153 0.004272 0.006829 0.02154 0.001802 14.67 16.93 94.17  661.1  0.1170 0.10720 0.037320  0.05802   \n",
       "13.05 19.31 82.61  527.2  0.08060 0.03789 0.000692 0.004167 0.1819 0.05501 0.4040 1.2140 2.595 32.96  0.007491 0.008593 0.000692 0.004167 0.02190 0.002990 14.23 22.25 90.24  624.1  0.1021 0.06191 0.001845  0.01111   \n",
       "19.53 18.90 129.50 1217.0 0.11500 0.16420 0.219700 0.106200 0.1792 0.06552 1.1110 1.1610 7.237 133.00 0.006056 0.032030 0.056380 0.017330 0.01884 0.004787 25.93 26.24 171.10 2053.0 0.1495 0.41160 0.612100  0.19800   \n",
       "...                                                                                                                                                                                                               ...   \n",
       "13.46 18.75 87.44  551.1  0.10750 0.11380 0.042010 0.031520 0.1723 0.06317 0.1998 0.6068 1.443 16.07  0.004413 0.014430 0.015090 0.007369 0.01354 0.001787 15.35 25.16 101.90 719.8  0.1624 0.31240 0.265400  0.14270   \n",
       "18.45 21.91 120.20 1075.0 0.09430 0.09709 0.115300 0.068470 0.1692 0.05727 0.5959 1.2020 3.766 68.35  0.006001 0.014220 0.028550 0.009148 0.01492 0.002205 22.52 31.39 145.60 1590.0 0.1465 0.22750 0.396500  0.13790   \n",
       "11.25 14.78 71.38  390.0  0.08306 0.04458 0.000974 0.002941 0.1773 0.06081 0.2144 0.9961 1.529 15.07  0.005617 0.007124 0.000974 0.002941 0.01700 0.002030 12.76 22.06 82.08  492.7  0.1166 0.09794 0.005518  0.01667   \n",
       "11.71 15.45 75.03  420.3  0.11500 0.07281 0.040060 0.032500 0.2009 0.06506 0.3446 0.7395 2.355 24.53  0.009536 0.010970 0.016510 0.011210 0.01953 0.003100 13.06 18.16 84.16  516.4  0.1460 0.11150 0.108700  0.07864   \n",
       "11.74 14.02 74.24  427.3  0.07813 0.04340 0.022450 0.027630 0.2101 0.06113 0.5619 1.2680 3.717 37.83  0.008034 0.014420 0.015140 0.018460 0.02921 0.002005 13.31 18.26 84.70  533.7  0.1036 0.08500 0.067350  0.08290   \n",
       "\n",
       "                                                                                                                                                                                                                  30  \\\n",
       "14.81 14.70 94.66  680.7  0.08472 0.05016 0.034160 0.025410 0.1659 0.05348 0.2182 0.6232 1.677 20.72  0.006708 0.011970 0.014820 0.010560 0.01580 0.001779 15.61 17.58 101.70 760.2  0.1139 0.10110 0.110100  0.2334   \n",
       "11.71 16.67 74.72  423.6  0.10510 0.06095 0.035920 0.026000 0.1339 0.05945 0.4489 2.5080 3.258 34.37  0.006578 0.013800 0.026620 0.013070 0.01359 0.003707 13.33 25.48 86.16  546.7  0.1271 0.10280 0.104600  0.1712   \n",
       "13.77 13.27 88.06  582.7  0.09198 0.06221 0.010630 0.019170 0.1592 0.05912 0.2191 0.6946 1.479 17.74  0.004348 0.008153 0.004272 0.006829 0.02154 0.001802 14.67 16.93 94.17  661.1  0.1170 0.10720 0.037320  0.2823   \n",
       "13.05 19.31 82.61  527.2  0.08060 0.03789 0.000692 0.004167 0.1819 0.05501 0.4040 1.2140 2.595 32.96  0.007491 0.008593 0.000692 0.004167 0.02190 0.002990 14.23 22.25 90.24  624.1  0.1021 0.06191 0.001845  0.2439   \n",
       "19.53 18.90 129.50 1217.0 0.11500 0.16420 0.219700 0.106200 0.1792 0.06552 1.1110 1.1610 7.237 133.00 0.006056 0.032030 0.056380 0.017330 0.01884 0.004787 25.93 26.24 171.10 2053.0 0.1495 0.41160 0.612100  0.2968   \n",
       "...                                                                                                                                                                                                              ...   \n",
       "13.46 18.75 87.44  551.1  0.10750 0.11380 0.042010 0.031520 0.1723 0.06317 0.1998 0.6068 1.443 16.07  0.004413 0.014430 0.015090 0.007369 0.01354 0.001787 15.35 25.16 101.90 719.8  0.1624 0.31240 0.265400  0.3518   \n",
       "18.45 21.91 120.20 1075.0 0.09430 0.09709 0.115300 0.068470 0.1692 0.05727 0.5959 1.2020 3.766 68.35  0.006001 0.014220 0.028550 0.009148 0.01492 0.002205 22.52 31.39 145.60 1590.0 0.1465 0.22750 0.396500  0.3109   \n",
       "11.25 14.78 71.38  390.0  0.08306 0.04458 0.000974 0.002941 0.1773 0.06081 0.2144 0.9961 1.529 15.07  0.005617 0.007124 0.000974 0.002941 0.01700 0.002030 12.76 22.06 82.08  492.7  0.1166 0.09794 0.005518  0.2815   \n",
       "11.71 15.45 75.03  420.3  0.11500 0.07281 0.040060 0.032500 0.2009 0.06506 0.3446 0.7395 2.355 24.53  0.009536 0.010970 0.016510 0.011210 0.01953 0.003100 13.06 18.16 84.16  516.4  0.1460 0.11150 0.108700  0.2765   \n",
       "11.74 14.02 74.24  427.3  0.07813 0.04340 0.022450 0.027630 0.2101 0.06113 0.5619 1.2680 3.717 37.83  0.008034 0.014420 0.015140 0.018460 0.02921 0.002005 13.31 18.26 84.70  533.7  0.1036 0.08500 0.067350  0.3101   \n",
       "\n",
       "                                                                                                                                                                                                              malignant  \n",
       "14.81 14.70 94.66  680.7  0.08472 0.05016 0.034160 0.025410 0.1659 0.05348 0.2182 0.6232 1.677 20.72  0.006708 0.011970 0.014820 0.010560 0.01580 0.001779 15.61 17.58 101.70 760.2  0.1139 0.10110 0.110100    0.06142  \n",
       "11.71 16.67 74.72  423.6  0.10510 0.06095 0.035920 0.026000 0.1339 0.05945 0.4489 2.5080 3.258 34.37  0.006578 0.013800 0.026620 0.013070 0.01359 0.003707 13.33 25.48 86.16  546.7  0.1271 0.10280 0.104600    0.07343  \n",
       "13.77 13.27 88.06  582.7  0.09198 0.06221 0.010630 0.019170 0.1592 0.05912 0.2191 0.6946 1.479 17.74  0.004348 0.008153 0.004272 0.006829 0.02154 0.001802 14.67 16.93 94.17  661.1  0.1170 0.10720 0.037320    0.06794  \n",
       "13.05 19.31 82.61  527.2  0.08060 0.03789 0.000692 0.004167 0.1819 0.05501 0.4040 1.2140 2.595 32.96  0.007491 0.008593 0.000692 0.004167 0.02190 0.002990 14.23 22.25 90.24  624.1  0.1021 0.06191 0.001845    0.06289  \n",
       "19.53 18.90 129.50 1217.0 0.11500 0.16420 0.219700 0.106200 0.1792 0.06552 1.1110 1.1610 7.237 133.00 0.006056 0.032030 0.056380 0.017330 0.01884 0.004787 25.93 26.24 171.10 2053.0 0.1495 0.41160 0.612100    0.09929  \n",
       "...                                                                                                                                                                                                                 ...  \n",
       "13.46 18.75 87.44  551.1  0.10750 0.11380 0.042010 0.031520 0.1723 0.06317 0.1998 0.6068 1.443 16.07  0.004413 0.014430 0.015090 0.007369 0.01354 0.001787 15.35 25.16 101.90 719.8  0.1624 0.31240 0.265400    0.08665  \n",
       "18.45 21.91 120.20 1075.0 0.09430 0.09709 0.115300 0.068470 0.1692 0.05727 0.5959 1.2020 3.766 68.35  0.006001 0.014220 0.028550 0.009148 0.01492 0.002205 22.52 31.39 145.60 1590.0 0.1465 0.22750 0.396500    0.07610  \n",
       "11.25 14.78 71.38  390.0  0.08306 0.04458 0.000974 0.002941 0.1773 0.06081 0.2144 0.9961 1.529 15.07  0.005617 0.007124 0.000974 0.002941 0.01700 0.002030 12.76 22.06 82.08  492.7  0.1166 0.09794 0.005518    0.07418  \n",
       "11.71 15.45 75.03  420.3  0.11500 0.07281 0.040060 0.032500 0.2009 0.06506 0.3446 0.7395 2.355 24.53  0.009536 0.010970 0.016510 0.011210 0.01953 0.003100 13.06 18.16 84.16  516.4  0.1460 0.11150 0.108700    0.07806  \n",
       "11.74 14.02 74.24  427.3  0.07813 0.04340 0.022450 0.027630 0.2101 0.06113 0.5619 1.2680 3.717 37.83  0.008034 0.014420 0.015140 0.018460 0.02921 0.002005 13.31 18.26 84.70  533.7  0.1036 0.08500 0.067350    0.06688  \n",
       "\n",
       "[455 rows x 3 columns]"
      ]
     },
     "execution_count": 79,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X_train"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 80,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 使用交叉验证的方式划分训练集\n",
    "kf = KFold(n_splits=3, shuffle=True, random_state=42)\n",
    "# for train, test in kf.split(X_y_train):\n",
    "#     df_base_train = X_y_train.iloc[train]\n",
    "#     df_base_test = X_y_train.iloc[test]\n",
    "#     X_base_train = df_base_train.drop(columns=['benign'])\n",
    "#     y_base_train = df_base_train['benign']\n",
    "#     X_base_test = df_base_test.drop(columns=['benign'])\n",
    "#     y_base_test = df_base_test['benign']\n",
    "\n",
    "# X_base_train\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 81,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 计算训练预测样本的香农熵，并插入到新表中\n",
    "import math\n",
    "\n",
    "\n",
    "def insert_entropy(predict_train):\n",
    "    df = pd.DataFrame(predict_train)\n",
    "    df['entropy'] = df[[0, 1]].apply(lambda x: shannon_entropy(x[0], x[1]), axis=1)\n",
    "    return df\n",
    "\n",
    "# 香农熵\n",
    "\n",
    "\n",
    "def shannon_entropy(p, q):\n",
    "    if (p <= 0.000001 or q <= 0.000001):\n",
    "        return 0\n",
    "    else:\n",
    "        return -(p * math.log(p) + q * math.log(q))\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 82,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [1. , 0. ],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0.2, 0.8],\n",
       "       [0.8, 0.2],\n",
       "       [0. , 1. ],\n",
       "       [1. , 0. ],\n",
       "       [0. , 1. ],\n",
       "       [0.8, 0.2],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [1. , 0. ],\n",
       "       [1. , 0. ],\n",
       "       [0. , 1. ],\n",
       "       [0.8, 0.2],\n",
       "       [1. , 0. ],\n",
       "       [0.8, 0.2],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0.2, 0.8],\n",
       "       [0. , 1. ],\n",
       "       [1. , 0. ],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0.4, 0.6],\n",
       "       [0. , 1. ],\n",
       "       [1. , 0. ],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [1. , 0. ],\n",
       "       [0. , 1. ],\n",
       "       [0.8, 0.2],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [1. , 0. ],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0.8, 0.2],\n",
       "       [0.2, 0.8],\n",
       "       [0. , 1. ],\n",
       "       [0.6, 0.4],\n",
       "       [0.4, 0.6],\n",
       "       [0.4, 0.6],\n",
       "       [0. , 1. ],\n",
       "       [0.4, 0.6],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0.2, 0.8],\n",
       "       [1. , 0. ],\n",
       "       [1. , 0. ],\n",
       "       [1. , 0. ],\n",
       "       [1. , 0. ],\n",
       "       [0.8, 0.2],\n",
       "       [0. , 1. ],\n",
       "       [0.8, 0.2],\n",
       "       [0.2, 0.8],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [1. , 0. ],\n",
       "       [1. , 0. ],\n",
       "       [1. , 0. ],\n",
       "       [0.6, 0.4],\n",
       "       [0. , 1. ],\n",
       "       [1. , 0. ],\n",
       "       [0. , 1. ],\n",
       "       [0.2, 0.8],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0.4, 0.6],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0.6, 0.4],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0.6, 0.4],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0.8, 0.2],\n",
       "       [0.2, 0.8],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [1. , 0. ],\n",
       "       [1. , 0. ],\n",
       "       [0.8, 0.2],\n",
       "       [1. , 0. ],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0.2, 0.8],\n",
       "       [0. , 1. ],\n",
       "       [1. , 0. ],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [1. , 0. ],\n",
       "       [0.6, 0.4],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [1. , 0. ],\n",
       "       [0. , 1. ],\n",
       "       [0.2, 0.8],\n",
       "       [0.8, 0.2],\n",
       "       [1. , 0. ],\n",
       "       [1. , 0. ],\n",
       "       [0. , 1. ],\n",
       "       [0.8, 0.2],\n",
       "       [0.8, 0.2],\n",
       "       [0. , 1. ],\n",
       "       [0.2, 0.8],\n",
       "       [0.2, 0.8],\n",
       "       [0.4, 0.6],\n",
       "       [0.2, 0.8],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [1. , 0. ],\n",
       "       [1. , 0. ],\n",
       "       [1. , 0. ],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [1. , 0. ],\n",
       "       [0.6, 0.4],\n",
       "       [1. , 0. ],\n",
       "       [0. , 1. ],\n",
       "       [0.8, 0.2],\n",
       "       [0. , 1. ],\n",
       "       [0.2, 0.8],\n",
       "       [0.4, 0.6],\n",
       "       [1. , 0. ],\n",
       "       [1. , 0. ],\n",
       "       [0.6, 0.4],\n",
       "       [0. , 1. ],\n",
       "       [1. , 0. ],\n",
       "       [0. , 1. ],\n",
       "       [1. , 0. ],\n",
       "       [1. , 0. ],\n",
       "       [0.6, 0.4],\n",
       "       [1. , 0. ],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [1. , 0. ],\n",
       "       [0. , 1. ],\n",
       "       [0.4, 0.6],\n",
       "       [0.4, 0.6],\n",
       "       [1. , 0. ],\n",
       "       [0.6, 0.4],\n",
       "       [0. , 1. ],\n",
       "       [0.2, 0.8],\n",
       "       [1. , 0. ],\n",
       "       [0. , 1. ],\n",
       "       [0.2, 0.8],\n",
       "       [0.8, 0.2],\n",
       "       [1. , 0. ],\n",
       "       [0. , 1. ],\n",
       "       [1. , 0. ],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [1. , 0. ],\n",
       "       [1. , 0. ],\n",
       "       [0. , 1. ],\n",
       "       [0.4, 0.6],\n",
       "       [0. , 1. ],\n",
       "       [0.8, 0.2],\n",
       "       [0.4, 0.6],\n",
       "       [0. , 1. ],\n",
       "       [0.8, 0.2],\n",
       "       [0. , 1. ],\n",
       "       [0.8, 0.2],\n",
       "       [1. , 0. ],\n",
       "       [0. , 1. ],\n",
       "       [0.2, 0.8],\n",
       "       [0. , 1. ],\n",
       "       [0.2, 0.8],\n",
       "       [1. , 0. ],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0.4, 0.6],\n",
       "       [1. , 0. ],\n",
       "       [0.8, 0.2],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [1. , 0. ],\n",
       "       [0.2, 0.8],\n",
       "       [0. , 1. ],\n",
       "       [1. , 0. ],\n",
       "       [0. , 1. ],\n",
       "       [1. , 0. ],\n",
       "       [0.4, 0.6],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [1. , 0. ],\n",
       "       [0. , 1. ],\n",
       "       [1. , 0. ],\n",
       "       [1. , 0. ],\n",
       "       [0.2, 0.8],\n",
       "       [1. , 0. ],\n",
       "       [0. , 1. ],\n",
       "       [0.4, 0.6],\n",
       "       [1. , 0. ],\n",
       "       [0.8, 0.2],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0.6, 0.4],\n",
       "       [0.2, 0.8],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [1. , 0. ],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [1. , 0. ],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0.8, 0.2],\n",
       "       [0. , 1. ],\n",
       "       [0.8, 0.2],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0.8, 0.2],\n",
       "       [0. , 1. ],\n",
       "       [0.2, 0.8],\n",
       "       [0.4, 0.6],\n",
       "       [0.8, 0.2],\n",
       "       [1. , 0. ],\n",
       "       [0.2, 0.8],\n",
       "       [0.8, 0.2],\n",
       "       [0.4, 0.6],\n",
       "       [1. , 0. ],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0.6, 0.4],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0.6, 0.4],\n",
       "       [1. , 0. ],\n",
       "       [0. , 1. ],\n",
       "       [1. , 0. ],\n",
       "       [0. , 1. ],\n",
       "       [0.8, 0.2],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0.4, 0.6],\n",
       "       [1. , 0. ],\n",
       "       [1. , 0. ],\n",
       "       [0. , 1. ],\n",
       "       [0.2, 0.8],\n",
       "       [0.2, 0.8],\n",
       "       [0. , 1. ],\n",
       "       [1. , 0. ],\n",
       "       [0.4, 0.6],\n",
       "       [1. , 0. ],\n",
       "       [0. , 1. ],\n",
       "       [1. , 0. ],\n",
       "       [0. , 1. ],\n",
       "       [0.6, 0.4],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [1. , 0. ],\n",
       "       [0.2, 0.8],\n",
       "       [1. , 0. ],\n",
       "       [0.4, 0.6],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0.6, 0.4],\n",
       "       [1. , 0. ],\n",
       "       [1. , 0. ],\n",
       "       [0. , 1. ],\n",
       "       [1. , 0. ],\n",
       "       [0.2, 0.8],\n",
       "       [0.6, 0.4],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [1. , 0. ],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [1. , 0. ],\n",
       "       [1. , 0. ],\n",
       "       [0. , 1. ],\n",
       "       [1. , 0. ],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0.4, 0.6],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [1. , 0. ],\n",
       "       [0. , 1. ],\n",
       "       [0.6, 0.4],\n",
       "       [0. , 1. ],\n",
       "       [1. , 0. ],\n",
       "       [0. , 1. ],\n",
       "       [1. , 0. ],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0.2, 0.8],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [1. , 0. ],\n",
       "       [0. , 1. ],\n",
       "       [1. , 0. ],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0.2, 0.8],\n",
       "       [0. , 1. ],\n",
       "       [0.2, 0.8],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0.4, 0.6],\n",
       "       [0.6, 0.4],\n",
       "       [1. , 0. ],\n",
       "       [0. , 1. ],\n",
       "       [1. , 0. ],\n",
       "       [0.4, 0.6],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0.6, 0.4],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [1. , 0. ],\n",
       "       [1. , 0. ],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0.6, 0.4],\n",
       "       [1. , 0. ],\n",
       "       [0.2, 0.8],\n",
       "       [1. , 0. ],\n",
       "       [0. , 1. ],\n",
       "       [0.4, 0.6],\n",
       "       [0.6, 0.4],\n",
       "       [0.8, 0.2],\n",
       "       [1. , 0. ],\n",
       "       [1. , 0. ],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [1. , 0. ],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0.4, 0.6],\n",
       "       [1. , 0. ],\n",
       "       [0.6, 0.4],\n",
       "       [0.6, 0.4],\n",
       "       [0.8, 0.2],\n",
       "       [0.2, 0.8],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0.2, 0.8],\n",
       "       [0.6, 0.4],\n",
       "       [1. , 0. ],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [1. , 0. ],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [1. , 0. ],\n",
       "       [0. , 1. ],\n",
       "       [1. , 0. ],\n",
       "       [0.6, 0.4],\n",
       "       [0.2, 0.8],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [1. , 0. ],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [1. , 0. ],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [1. , 0. ],\n",
       "       [0.2, 0.8],\n",
       "       [1. , 0. ],\n",
       "       [1. , 0. ],\n",
       "       [0. , 1. ],\n",
       "       [0.4, 0.6],\n",
       "       [1. , 0. ],\n",
       "       [1. , 0. ],\n",
       "       [1. , 0. ],\n",
       "       [0. , 1. ],\n",
       "       [1. , 0. ],\n",
       "       [0.8, 0.2],\n",
       "       [1. , 0. ],\n",
       "       [0.8, 0.2],\n",
       "       [0. , 1. ],\n",
       "       [0.2, 0.8],\n",
       "       [0.2, 0.8],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [1. , 0. ],\n",
       "       [0. , 1. ],\n",
       "       [1. , 0. ],\n",
       "       [1. , 0. ],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0.6, 0.4],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0.2, 0.8],\n",
       "       [0. , 1. ],\n",
       "       [0.8, 0.2],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [1. , 0. ],\n",
       "       [0. , 1. ],\n",
       "       [0. , 1. ],\n",
       "       [0.4, 0.6],\n",
       "       [0. , 1. ]])"
      ]
     },
     "execution_count": 82,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# knn model\n",
    "knn = KNeighborsClassifier(n_neighbors=5)\n",
    "knn_probility_test = np.array([[.0, .0]])\n",
    "knn_y_test = pd.DataFrame()\n",
    "for train, test in kf.split(X_y_train):\n",
    "    df_base_train = X_y_train.iloc[train]\n",
    "    df_base_test = X_y_train.iloc[test]\n",
    "    X_base_train = df_base_train.drop(columns=['benign'])\n",
    "    y_base_train = df_base_train['benign']\n",
    "    X_base_test = df_base_test.drop(columns=['benign'])\n",
    "    y_base_test = df_base_test['benign']\n",
    "    df_y_base_test = pd.DataFrame(y_base_test)\n",
    "    knn.fit(X_base_train, y_base_train)\n",
    "    # knn_probility_train = knn.predict_proba(X_test)\n",
    "    knn_probility_test = np.concatenate((knn_probility_test, knn.predict_proba(X_base_test)), axis=0)\n",
    "    knn_y_test = knn_y_test.append(df_y_base_test)\n",
    "\n",
    "knn_probility_test = np.delete(knn_probility_test, 0, axis = 0)\n",
    "knn_probility_test\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 83,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "pandas.core.frame.DataFrame"
      ]
     },
     "execution_count": 83,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "type(knn_y_test)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 84,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "14.810  14.70  94.66   680.7   0.08472  0.05016  0.034160  0.025410  0.1659  0.05348  0.2182  0.6232  1.677  20.720   0.006708  0.011970  0.014820  0.010560  0.01580  0.001779  15.610  17.58  101.70  760.2   0.11390  0.10110  0.110100    1\n",
       "13.050  19.31  82.61   527.2   0.08060  0.03789  0.000692  0.004167  0.1819  0.05501  0.4040  1.2140  2.595  32.960   0.007491  0.008593  0.000692  0.004167  0.02190  0.002990  14.230  22.25  90.24   624.1   0.10210  0.06191  0.001845    1\n",
       "17.910  21.02  124.40  994.0   0.12300  0.25760  0.318900  0.119800  0.2113  0.07115  0.4030  0.7747  3.123  41.510   0.007159  0.037180  0.061650  0.010510  0.01591  0.005099  20.800  27.78  149.60  1304.0  0.18730  0.59170  0.903400    0\n",
       "8.196   16.84  51.71   201.9   0.08600  0.05943  0.015880  0.005917  0.1769  0.06503  0.1563  0.9567  1.094  8.205    0.008968  0.016460  0.015880  0.005917  0.02574  0.002582  8.964   21.96  57.26   242.2   0.12970  0.13570  0.068800    1\n",
       "14.800  17.66  95.88   674.8   0.09179  0.08890  0.040690  0.022600  0.1893  0.05886  0.2204  0.6221  1.482  19.750   0.004796  0.011710  0.017580  0.006897  0.02254  0.001971  16.430  22.74  105.90  829.5   0.12260  0.18810  0.206000    1\n",
       "                                                                                                                                                                                                                                             ..\n",
       "14.950  17.57  96.85   678.1   0.11670  0.13050  0.153900  0.086240  0.1957  0.06216  1.2960  1.4520  8.419  101.900  0.010000  0.034800  0.065770  0.028010  0.05168  0.002887  18.550  21.43  121.40  971.4   0.14110  0.21640  0.335500    0\n",
       "12.030  17.93  76.09   446.0   0.07683  0.03892  0.001546  0.005592  0.1382  0.06070  0.2335  0.9097  1.466  16.970   0.004729  0.006887  0.001184  0.003951  0.01466  0.001755  13.070  22.25  82.74   523.4   0.10130  0.07390  0.007732    1\n",
       "11.220  33.81  70.79   386.8   0.07780  0.03574  0.004967  0.006434  0.1845  0.05828  0.2239  1.6470  1.489  15.460   0.004359  0.006813  0.003223  0.003419  0.01916  0.002534  12.360  41.78  78.44   470.9   0.09994  0.06885  0.023180    1\n",
       "18.450  21.91  120.20  1075.0  0.09430  0.09709  0.115300  0.068470  0.1692  0.05727  0.5959  1.2020  3.766  68.350   0.006001  0.014220  0.028550  0.009148  0.01492  0.002205  22.520  31.39  145.60  1590.0  0.14650  0.22750  0.396500    0\n",
       "11.740  14.02  74.24   427.3   0.07813  0.04340  0.022450  0.027630  0.2101  0.06113  0.5619  1.2680  3.717  37.830   0.008034  0.014420  0.015140  0.018460  0.02921  0.002005  13.310  18.26  84.70   533.7   0.10360  0.08500  0.067350    1\n",
       "Name: benign, Length: 455, dtype: int64"
      ]
     },
     "execution_count": 84,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "knn_y_test[\"benign\"]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 85,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>0</th>\n",
       "      <th>1</th>\n",
       "      <th>entropy</th>\n",
       "      <th>benign</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>450</th>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>451</th>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>452</th>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>453</th>\n",
       "      <td>0.4</td>\n",
       "      <td>0.6</td>\n",
       "      <td>0.673012</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>454</th>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>455 rows × 4 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "       0    1   entropy  benign\n",
       "0    0.0  1.0  0.000000       1\n",
       "1    0.0  1.0  0.000000       1\n",
       "2    1.0  0.0  0.000000       0\n",
       "3    0.0  1.0  0.000000       1\n",
       "4    0.0  1.0  0.000000       1\n",
       "..   ...  ...       ...     ...\n",
       "450  1.0  0.0  0.000000       0\n",
       "451  0.0  1.0  0.000000       1\n",
       "452  0.0  1.0  0.000000       1\n",
       "453  0.4  0.6  0.673012       0\n",
       "454  0.0  1.0  0.000000       1\n",
       "\n",
       "[455 rows x 4 columns]"
      ]
     },
     "execution_count": 85,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_knn_probility_test = insert_entropy(knn_probility_test)\n",
    "df_knn_probility_test.insert(loc=len(df_knn_probility_test.columns), column='benign', value=knn_y_test['benign'].values)\n",
    "df_knn_probility_test.to_csv('knn_probility_test.csv')\n",
    "df_knn_probility_test"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 86,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[0.21566583, 0.78433417],\n",
       "       [0.16647735, 0.83352265],\n",
       "       [0.32945436, 0.67054564],\n",
       "       [0.18230763, 0.81769237],\n",
       "       [0.23336147, 0.76663853],\n",
       "       [0.25901596, 0.74098404],\n",
       "       [0.23112194, 0.76887806],\n",
       "       [0.32760044, 0.67239956],\n",
       "       [0.21188748, 0.78811252],\n",
       "       [0.33231787, 0.66768213],\n",
       "       [0.17247197, 0.82752803],\n",
       "       [0.29435262, 0.70564738],\n",
       "       [0.19846047, 0.80153953],\n",
       "       [0.2219088 , 0.7780912 ],\n",
       "       [0.20239971, 0.79760029],\n",
       "       [0.2064508 , 0.7935492 ],\n",
       "       [0.23424464, 0.76575536],\n",
       "       [0.45430785, 0.54569215],\n",
       "       [0.32335448, 0.67664552],\n",
       "       [0.215652  , 0.784348  ],\n",
       "       [0.29577001, 0.70422999],\n",
       "       [0.34433544, 0.65566456],\n",
       "       [0.31711997, 0.68288003],\n",
       "       [0.22783444, 0.77216556],\n",
       "       [0.17506764, 0.82493236],\n",
       "       [0.21846568, 0.78153432],\n",
       "       [0.20309235, 0.79690765],\n",
       "       [0.19959854, 0.80040146],\n",
       "       [0.2082913 , 0.7917087 ],\n",
       "       [0.28009599, 0.71990401],\n",
       "       [0.21707932, 0.78292068],\n",
       "       [0.31077432, 0.68922568],\n",
       "       [0.19674318, 0.80325682],\n",
       "       [0.21428433, 0.78571567],\n",
       "       [0.28725607, 0.71274393],\n",
       "       [0.22886527, 0.77113473],\n",
       "       [0.35970222, 0.64029778],\n",
       "       [0.21106383, 0.78893617],\n",
       "       [0.19268349, 0.80731651],\n",
       "       [0.35416536, 0.64583464],\n",
       "       [0.17240238, 0.82759762],\n",
       "       [0.28383633, 0.71616367],\n",
       "       [0.20752748, 0.79247252],\n",
       "       [0.19386394, 0.80613606],\n",
       "       [0.34584171, 0.65415829],\n",
       "       [0.21573148, 0.78426852],\n",
       "       [0.19560733, 0.80439267],\n",
       "       [0.30214321, 0.69785679],\n",
       "       [0.2234439 , 0.7765561 ],\n",
       "       [0.17624475, 0.82375525],\n",
       "       [0.24715319, 0.75284681],\n",
       "       [0.27078874, 0.72921126],\n",
       "       [0.2445275 , 0.7554725 ],\n",
       "       [0.21686431, 0.78313569],\n",
       "       [0.2655958 , 0.7344042 ],\n",
       "       [0.1873646 , 0.8126354 ],\n",
       "       [0.16280062, 0.83719938],\n",
       "       [0.16101707, 0.83898293],\n",
       "       [0.28495288, 0.71504712],\n",
       "       [0.42805035, 0.57194965],\n",
       "       [0.33011291, 0.66988709],\n",
       "       [0.33046874, 0.66953126],\n",
       "       [0.33272504, 0.66727496],\n",
       "       [0.28167976, 0.71832024],\n",
       "       [0.22244995, 0.77755005],\n",
       "       [0.31889896, 0.68110104],\n",
       "       [0.2397801 , 0.7602199 ],\n",
       "       [0.21535885, 0.78464115],\n",
       "       [0.26718511, 0.73281489],\n",
       "       [0.32376109, 0.67623891],\n",
       "       [0.32951471, 0.67048529],\n",
       "       [0.30519525, 0.69480475],\n",
       "       [0.28796737, 0.71203263],\n",
       "       [0.2380933 , 0.7619067 ],\n",
       "       [0.33904459, 0.66095541],\n",
       "       [0.21212079, 0.78787921],\n",
       "       [0.23086173, 0.76913827],\n",
       "       [0.21282275, 0.78717725],\n",
       "       [0.20145552, 0.79854448],\n",
       "       [0.24716772, 0.75283228],\n",
       "       [0.2624726 , 0.7375274 ],\n",
       "       [0.20685822, 0.79314178],\n",
       "       [0.20019435, 0.79980565],\n",
       "       [0.2561521 , 0.7438479 ],\n",
       "       [0.20899182, 0.79100818],\n",
       "       [0.1904008 , 0.8095992 ],\n",
       "       [0.27021304, 0.72978696],\n",
       "       [0.17020848, 0.82979152],\n",
       "       [0.25497745, 0.74502255],\n",
       "       [0.29311441, 0.70688559],\n",
       "       [0.26241448, 0.73758552],\n",
       "       [0.21731168, 0.78268832],\n",
       "       [0.19528488, 0.80471512],\n",
       "       [0.35417883, 0.64582117],\n",
       "       [0.33768536, 0.66231464],\n",
       "       [0.30888055, 0.69111945],\n",
       "       [0.31562201, 0.68437799],\n",
       "       [0.23932393, 0.76067607],\n",
       "       [0.2170454 , 0.7829546 ],\n",
       "       [0.23742713, 0.76257287],\n",
       "       [0.21859425, 0.78140575],\n",
       "       [0.34828376, 0.65171624],\n",
       "       [0.22567482, 0.77432518],\n",
       "       [0.22185221, 0.77814779],\n",
       "       [0.16425569, 0.83574431],\n",
       "       [0.27461119, 0.72538881],\n",
       "       [0.28949716, 0.71050284],\n",
       "       [0.2106853 , 0.7893147 ],\n",
       "       [0.24416458, 0.75583542],\n",
       "       [0.4170959 , 0.5829041 ],\n",
       "       [0.18202516, 0.81797484],\n",
       "       [0.24044684, 0.75955316],\n",
       "       [0.29184678, 0.70815322],\n",
       "       [0.33624535, 0.66375465],\n",
       "       [0.3608328 , 0.6391672 ],\n",
       "       [0.2085556 , 0.7914444 ],\n",
       "       [0.28563485, 0.71436515],\n",
       "       [0.30871324, 0.69128676],\n",
       "       [0.20172254, 0.79827746],\n",
       "       [0.23319464, 0.76680536],\n",
       "       [0.25822312, 0.74177688],\n",
       "       [0.25238025, 0.74761975],\n",
       "       [0.26961514, 0.73038486],\n",
       "       [0.25001639, 0.74998361],\n",
       "       [0.22603712, 0.77396288],\n",
       "       [0.2326659 , 0.7673341 ],\n",
       "       [0.39114416, 0.60885584],\n",
       "       [0.33472845, 0.66527155],\n",
       "       [0.36422777, 0.63577223],\n",
       "       [0.24116023, 0.75883977],\n",
       "       [0.16208027, 0.83791973],\n",
       "       [0.21752085, 0.78247915],\n",
       "       [0.16966774, 0.83033226],\n",
       "       [0.20056142, 0.79943858],\n",
       "       [0.33328733, 0.66671267],\n",
       "       [0.23990926, 0.76009074],\n",
       "       [0.44796083, 0.55203917],\n",
       "       [0.20343815, 0.79656185],\n",
       "       [0.27407697, 0.72592303],\n",
       "       [0.18532529, 0.81467471],\n",
       "       [0.22834565, 0.77165435],\n",
       "       [0.2626766 , 0.7373234 ],\n",
       "       [0.30666017, 0.69333983],\n",
       "       [0.45437412, 0.54562588],\n",
       "       [0.26590847, 0.73409153],\n",
       "       [0.17650642, 0.82349358],\n",
       "       [0.38761467, 0.61238533],\n",
       "       [0.15382185, 0.84617815],\n",
       "       [0.28541176, 0.71458824],\n",
       "       [0.30725428, 0.69274572],\n",
       "       [0.24723411, 0.75276589],\n",
       "       [0.28463412, 0.71536588],\n",
       "       [0.26654075, 0.73345925],\n",
       "       [0.25904434, 0.74095566],\n",
       "       [0.26520794, 0.73479206],\n",
       "       [0.43032741, 0.56967259],\n",
       "       [0.21678268, 0.78321732],\n",
       "       [0.31488893, 0.68511107],\n",
       "       [0.31110086, 0.68889914],\n",
       "       [0.40845835, 0.59154165],\n",
       "       [0.3153655 , 0.6846345 ],\n",
       "       [0.24908026, 0.75091974],\n",
       "       [0.27351619, 0.72648381],\n",
       "       [0.40312836, 0.59687164],\n",
       "       [0.26827008, 0.73172992],\n",
       "       [0.24241619, 0.75758381],\n",
       "       [0.36603743, 0.63396257],\n",
       "       [0.38250152, 0.61749848],\n",
       "       [0.30554496, 0.69445504],\n",
       "       [0.47520962, 0.52479038],\n",
       "       [0.243797  , 0.756203  ],\n",
       "       [0.27754637, 0.72245363],\n",
       "       [0.41069728, 0.58930272],\n",
       "       [0.45490975, 0.54509025],\n",
       "       [0.26223326, 0.73776674],\n",
       "       [0.34041395, 0.65958605],\n",
       "       [0.26953343, 0.73046657],\n",
       "       [0.36805917, 0.63194083],\n",
       "       [0.3537099 , 0.6462901 ],\n",
       "       [0.26918721, 0.73081279],\n",
       "       [0.36251545, 0.63748455],\n",
       "       [0.30422888, 0.69577112],\n",
       "       [0.35471011, 0.64528989],\n",
       "       [0.37272554, 0.62727446],\n",
       "       [0.27927825, 0.72072175],\n",
       "       [0.28301286, 0.71698714],\n",
       "       [0.27624976, 0.72375024],\n",
       "       [0.24487836, 0.75512164],\n",
       "       [0.43716089, 0.56283911],\n",
       "       [0.25363208, 0.74636792],\n",
       "       [0.25945807, 0.74054193],\n",
       "       [0.3410291 , 0.6589709 ],\n",
       "       [0.41293366, 0.58706634],\n",
       "       [0.34789383, 0.65210617],\n",
       "       [0.28727493, 0.71272507],\n",
       "       [0.23892444, 0.76107556],\n",
       "       [0.28061411, 0.71938589],\n",
       "       [0.27918747, 0.72081253],\n",
       "       [0.35996048, 0.64003952],\n",
       "       [0.28441717, 0.71558283],\n",
       "       [0.26612371, 0.73387629],\n",
       "       [0.41177575, 0.58822425],\n",
       "       [0.23834371, 0.76165629],\n",
       "       [0.3957564 , 0.6042436 ],\n",
       "       [0.3275261 , 0.6724739 ],\n",
       "       [0.24580376, 0.75419624],\n",
       "       [0.26713037, 0.73286963],\n",
       "       [0.27137745, 0.72862255],\n",
       "       [0.38074291, 0.61925709],\n",
       "       [0.2735651 , 0.7264349 ],\n",
       "       [0.3833447 , 0.6166553 ],\n",
       "       [0.3337916 , 0.6662084 ],\n",
       "       [0.31266147, 0.68733853],\n",
       "       [0.41946315, 0.58053685],\n",
       "       [0.28072554, 0.71927446],\n",
       "       [0.33747755, 0.66252245],\n",
       "       [0.37876314, 0.62123686],\n",
       "       [0.35051076, 0.64948924],\n",
       "       [0.24543754, 0.75456246],\n",
       "       [0.24734612, 0.75265388],\n",
       "       [0.32707227, 0.67292773],\n",
       "       [0.31000163, 0.68999837],\n",
       "       [0.27752591, 0.72247409],\n",
       "       [0.22546009, 0.77453991],\n",
       "       [0.38372403, 0.61627597],\n",
       "       [0.24697899, 0.75302101],\n",
       "       [0.23049567, 0.76950433],\n",
       "       [0.29689559, 0.70310441],\n",
       "       [0.3950051 , 0.6049949 ],\n",
       "       [0.23603664, 0.76396336],\n",
       "       [0.2804684 , 0.7195316 ],\n",
       "       [0.21946284, 0.78053716],\n",
       "       [0.27712516, 0.72287484],\n",
       "       [0.26534225, 0.73465775],\n",
       "       [0.35640002, 0.64359998],\n",
       "       [0.29764449, 0.70235551],\n",
       "       [0.36150763, 0.63849237],\n",
       "       [0.27288729, 0.72711271],\n",
       "       [0.2744796 , 0.7255204 ],\n",
       "       [0.29549147, 0.70450853],\n",
       "       [0.24110042, 0.75889958],\n",
       "       [0.37067089, 0.62932911],\n",
       "       [0.29207365, 0.70792635],\n",
       "       [0.33817239, 0.66182761],\n",
       "       [0.30991052, 0.69008948],\n",
       "       [0.34218769, 0.65781231],\n",
       "       [0.38431961, 0.61568039],\n",
       "       [0.31072241, 0.68927759],\n",
       "       [0.42065398, 0.57934602],\n",
       "       [0.32035873, 0.67964127],\n",
       "       [0.3720046 , 0.6279954 ],\n",
       "       [0.3032015 , 0.6967985 ],\n",
       "       [0.28252895, 0.71747105],\n",
       "       [0.33581854, 0.66418146],\n",
       "       [0.27183313, 0.72816687],\n",
       "       [0.28820203, 0.71179797],\n",
       "       [0.34115683, 0.65884317],\n",
       "       [0.44936873, 0.55063127],\n",
       "       [0.27826775, 0.72173225],\n",
       "       [0.40200207, 0.59799793],\n",
       "       [0.2940336 , 0.7059664 ],\n",
       "       [0.35767216, 0.64232784],\n",
       "       [0.2798108 , 0.7201892 ],\n",
       "       [0.23490243, 0.76509757],\n",
       "       [0.34247729, 0.65752271],\n",
       "       [0.39101765, 0.60898235],\n",
       "       [0.40863051, 0.59136949],\n",
       "       [0.27349558, 0.72650442],\n",
       "       [0.29178514, 0.70821486],\n",
       "       [0.31602815, 0.68397185],\n",
       "       [0.29475594, 0.70524406],\n",
       "       [0.476583  , 0.523417  ],\n",
       "       [0.31899834, 0.68100166],\n",
       "       [0.35234984, 0.64765016],\n",
       "       [0.28055392, 0.71944608],\n",
       "       [0.37576699, 0.62423301],\n",
       "       [0.23826528, 0.76173472],\n",
       "       [0.31587273, 0.68412727],\n",
       "       [0.28669805, 0.71330195],\n",
       "       [0.24140107, 0.75859893],\n",
       "       [0.32637532, 0.67362468],\n",
       "       [0.49822875, 0.50177125],\n",
       "       [0.28412432, 0.71587568],\n",
       "       [0.40943925, 0.59056075],\n",
       "       [0.34307001, 0.65692999],\n",
       "       [0.29021238, 0.70978762],\n",
       "       [0.25937277, 0.74062723],\n",
       "       [0.27832478, 0.72167522],\n",
       "       [0.33868575, 0.66131425],\n",
       "       [0.42313049, 0.57686951],\n",
       "       [0.4639543 , 0.5360457 ],\n",
       "       [0.2617629 , 0.7382371 ],\n",
       "       [0.42081887, 0.57918113],\n",
       "       [0.29790768, 0.70209232],\n",
       "       [0.34864975, 0.65135025],\n",
       "       [0.25228556, 0.74771444],\n",
       "       [0.26133716, 0.73866284],\n",
       "       [0.27235398, 0.72764602],\n",
       "       [0.40865551, 0.59134449],\n",
       "       [0.28475409, 0.71524591],\n",
       "       [0.21521024, 0.78478976],\n",
       "       [0.28282442, 0.71717558],\n",
       "       [0.23175371, 0.76824629],\n",
       "       [0.28255408, 0.71744592],\n",
       "       [0.27181202, 0.72818798],\n",
       "       [0.4167684 , 0.5832316 ],\n",
       "       [0.46945651, 0.53054349],\n",
       "       [0.26593023, 0.73406977],\n",
       "       [0.40007357, 0.59992643],\n",
       "       [0.30304368, 0.69695632],\n",
       "       [0.28826281, 0.71173719],\n",
       "       [0.27827368, 0.72172632],\n",
       "       [0.34353594, 0.65646406],\n",
       "       [0.32491792, 0.67508208],\n",
       "       [0.29389556, 0.70610444],\n",
       "       [0.37444034, 0.62555966],\n",
       "       [0.23941786, 0.76058214],\n",
       "       [0.36460659, 0.63539341],\n",
       "       [0.27612307, 0.72387693],\n",
       "       [0.41583206, 0.58416794],\n",
       "       [0.27263047, 0.72736953],\n",
       "       [0.43737059, 0.56262941],\n",
       "       [0.25515976, 0.74484024],\n",
       "       [0.28642597, 0.71357403],\n",
       "       [0.28454175, 0.71545825],\n",
       "       [0.29025293, 0.70974707],\n",
       "       [0.33131599, 0.66868401],\n",
       "       [0.28954828, 0.71045172],\n",
       "       [0.2699036 , 0.7300964 ],\n",
       "       [0.37911418, 0.62088582],\n",
       "       [0.24875445, 0.75124555],\n",
       "       [0.47890215, 0.52109785],\n",
       "       [0.23385321, 0.76614679],\n",
       "       [0.25920207, 0.74079793],\n",
       "       [0.21414826, 0.78585174],\n",
       "       [0.27395063, 0.72604937],\n",
       "       [0.31561915, 0.68438085],\n",
       "       [0.26319817, 0.73680183],\n",
       "       [0.35759632, 0.64240368],\n",
       "       [0.25729997, 0.74270003],\n",
       "       [0.29503838, 0.70496162],\n",
       "       [0.28388646, 0.71611354],\n",
       "       [0.33284314, 0.66715686],\n",
       "       [0.35397298, 0.64602702],\n",
       "       [0.40139684, 0.59860316],\n",
       "       [0.25696903, 0.74303097],\n",
       "       [0.38266028, 0.61733972],\n",
       "       [0.34226154, 0.65773846],\n",
       "       [0.29555327, 0.70444673],\n",
       "       [0.27015029, 0.72984971],\n",
       "       [0.35814935, 0.64185065],\n",
       "       [0.23799312, 0.76200688],\n",
       "       [0.24910881, 0.75089119],\n",
       "       [0.42408251, 0.57591749],\n",
       "       [0.45265037, 0.54734963],\n",
       "       [0.28802029, 0.71197971],\n",
       "       [0.31477524, 0.68522476],\n",
       "       [0.35384837, 0.64615163],\n",
       "       [0.38990195, 0.61009805],\n",
       "       [0.30659587, 0.69340413],\n",
       "       [0.47259869, 0.52740131],\n",
       "       [0.28334592, 0.71665408],\n",
       "       [0.35145831, 0.64854169],\n",
       "       [0.32619836, 0.67380164],\n",
       "       [0.41342259, 0.58657741],\n",
       "       [0.40304452, 0.59695548],\n",
       "       [0.44007041, 0.55992959],\n",
       "       [0.29942308, 0.70057692],\n",
       "       [0.25679736, 0.74320264],\n",
       "       [0.25997017, 0.74002983],\n",
       "       [0.39769934, 0.60230066],\n",
       "       [0.25329671, 0.74670329],\n",
       "       [0.2609085 , 0.7390915 ],\n",
       "       [0.34419899, 0.65580101],\n",
       "       [0.38311479, 0.61688521],\n",
       "       [0.33641725, 0.66358275],\n",
       "       [0.36300545, 0.63699455],\n",
       "       [0.37153235, 0.62846765],\n",
       "       [0.29512836, 0.70487164],\n",
       "       [0.32101918, 0.67898082],\n",
       "       [0.2594617 , 0.7405383 ],\n",
       "       [0.28454079, 0.71545921],\n",
       "       [0.28890257, 0.71109743],\n",
       "       [0.21074173, 0.78925827],\n",
       "       [0.36161454, 0.63838546],\n",
       "       [0.51285188, 0.48714812],\n",
       "       [0.23022538, 0.76977462],\n",
       "       [0.21352955, 0.78647045],\n",
       "       [0.22439204, 0.77560796],\n",
       "       [0.38869708, 0.61130292],\n",
       "       [0.25699188, 0.74300812],\n",
       "       [0.30568997, 0.69431003],\n",
       "       [0.29775726, 0.70224274],\n",
       "       [0.27585951, 0.72414049],\n",
       "       [0.50211962, 0.49788038],\n",
       "       [0.27313366, 0.72686634],\n",
       "       [0.40018591, 0.59981409],\n",
       "       [0.32065707, 0.67934293],\n",
       "       [0.31316185, 0.68683815],\n",
       "       [0.29511152, 0.70488848],\n",
       "       [0.26947381, 0.73052619],\n",
       "       [0.44385775, 0.55614225],\n",
       "       [0.2989156 , 0.7010844 ],\n",
       "       [0.31578005, 0.68421995],\n",
       "       [0.47257571, 0.52742429],\n",
       "       [0.25502562, 0.74497438],\n",
       "       [0.26045048, 0.73954952],\n",
       "       [0.27736242, 0.72263758],\n",
       "       [0.29894414, 0.70105586],\n",
       "       [0.2478903 , 0.7521097 ],\n",
       "       [0.4071899 , 0.5928101 ],\n",
       "       [0.31134604, 0.68865396],\n",
       "       [0.47254772, 0.52745228],\n",
       "       [0.42433834, 0.57566166],\n",
       "       [0.27839539, 0.72160461],\n",
       "       [0.35031763, 0.64968237],\n",
       "       [0.36496352, 0.63503648],\n",
       "       [0.38849678, 0.61150322],\n",
       "       [0.45586747, 0.54413253],\n",
       "       [0.2822073 , 0.7177927 ],\n",
       "       [0.39492112, 0.60507888],\n",
       "       [0.36234075, 0.63765925],\n",
       "       [0.37850573, 0.62149427],\n",
       "       [0.39127304, 0.60872696],\n",
       "       [0.32825989, 0.67174011],\n",
       "       [0.32000003, 0.67999997],\n",
       "       [0.30661811, 0.69338189],\n",
       "       [0.2757588 , 0.7242412 ],\n",
       "       [0.26575408, 0.73424592],\n",
       "       [0.24882882, 0.75117118],\n",
       "       [0.29679771, 0.70320229],\n",
       "       [0.42028183, 0.57971817],\n",
       "       [0.27158507, 0.72841493],\n",
       "       [0.49182913, 0.50817087],\n",
       "       [0.39613842, 0.60386158],\n",
       "       [0.28276826, 0.71723174],\n",
       "       [0.34634287, 0.65365713],\n",
       "       [0.36603592, 0.63396408],\n",
       "       [0.24619747, 0.75380253],\n",
       "       [0.26223047, 0.73776953],\n",
       "       [0.26431104, 0.73568896],\n",
       "       [0.25954999, 0.74045001],\n",
       "       [0.30641275, 0.69358725],\n",
       "       [0.31018432, 0.68981568],\n",
       "       [0.26179582, 0.73820418],\n",
       "       [0.27123084, 0.72876916],\n",
       "       [0.40821365, 0.59178635],\n",
       "       [0.2730943 , 0.7269057 ],\n",
       "       [0.26859276, 0.73140724],\n",
       "       [0.25459943, 0.74540057],\n",
       "       [0.38891914, 0.61108086],\n",
       "       [0.23629963, 0.76370037],\n",
       "       [0.24207964, 0.75792036],\n",
       "       [0.35269489, 0.64730511],\n",
       "       [0.29525683, 0.70474317]])"
      ]
     },
     "execution_count": 86,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "lda = LDA(n_components=1)\n",
    "lda_probility_test = np.array([[.0, .0]])\n",
    "for train, test in kf.split(X_y_train):\n",
    "    df_base_train = X_y_train.iloc[train]\n",
    "    df_base_test = X_y_train.iloc[test]\n",
    "    X_base_train = df_base_train.drop(columns=['benign'])\n",
    "    y_base_train = df_base_train['benign']\n",
    "    X_base_test = df_base_test.drop(columns=['benign'])\n",
    "    y_base_test = df_base_test['benign']\n",
    "    sc = StandardScaler()\n",
    "    X_base_train_std = sc.fit_transform(X_base_train)\n",
    "    X_base_test_std = sc.fit_transform(X_base_test)\n",
    "    lda.fit_transform(X_base_train_std, y_base_train)\n",
    "    lda_probility_test = np.concatenate((lda_probility_test, lda.predict_proba(X_base_test)), axis=0)\n",
    "\n",
    "lda_probility_test = np.delete(lda_probility_test, 0, axis = 0)\n",
    "lda_probility_test"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 87,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>0</th>\n",
       "      <th>1</th>\n",
       "      <th>entropy</th>\n",
       "      <th>benign</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0.215666</td>\n",
       "      <td>0.784334</td>\n",
       "      <td>0.521367</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0.166477</td>\n",
       "      <td>0.833523</td>\n",
       "      <td>0.450256</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0.329454</td>\n",
       "      <td>0.670546</td>\n",
       "      <td>0.633792</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0.182308</td>\n",
       "      <td>0.817692</td>\n",
       "      <td>0.474875</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0.233361</td>\n",
       "      <td>0.766639</td>\n",
       "      <td>0.543306</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>450</th>\n",
       "      <td>0.388919</td>\n",
       "      <td>0.611081</td>\n",
       "      <td>0.668262</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>451</th>\n",
       "      <td>0.236300</td>\n",
       "      <td>0.763700</td>\n",
       "      <td>0.546777</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>452</th>\n",
       "      <td>0.242080</td>\n",
       "      <td>0.757920</td>\n",
       "      <td>0.553465</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>453</th>\n",
       "      <td>0.352695</td>\n",
       "      <td>0.647305</td>\n",
       "      <td>0.649099</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>454</th>\n",
       "      <td>0.295257</td>\n",
       "      <td>0.704743</td>\n",
       "      <td>0.606792</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>455 rows × 4 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "            0         1   entropy  benign\n",
       "0    0.215666  0.784334  0.521367       1\n",
       "1    0.166477  0.833523  0.450256       1\n",
       "2    0.329454  0.670546  0.633792       0\n",
       "3    0.182308  0.817692  0.474875       1\n",
       "4    0.233361  0.766639  0.543306       1\n",
       "..        ...       ...       ...     ...\n",
       "450  0.388919  0.611081  0.668262       0\n",
       "451  0.236300  0.763700  0.546777       1\n",
       "452  0.242080  0.757920  0.553465       1\n",
       "453  0.352695  0.647305  0.649099       0\n",
       "454  0.295257  0.704743  0.606792       1\n",
       "\n",
       "[455 rows x 4 columns]"
      ]
     },
     "execution_count": 87,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_lda_probility_test = insert_entropy(lda_probility_test)\n",
    "df_lda_probility_test.insert(loc=len(df_lda_probility_test.columns), column='benign', value=knn_y_test['benign'].values)\n",
    "df_lda_probility_test.to_csv('lda_probility_test.csv')\n",
    "df_lda_probility_test"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 88,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[5.34962442e-03, 9.94650376e-01],\n",
       "       [1.76731855e-04, 9.99823268e-01],\n",
       "       [9.99804849e-01, 1.95151248e-04],\n",
       "       [9.82978998e-04, 9.99017021e-01],\n",
       "       [1.16579739e-01, 8.83420261e-01],\n",
       "       [4.95607966e-01, 5.04392034e-01],\n",
       "       [2.41668259e-02, 9.75833174e-01],\n",
       "       [9.94736474e-01, 5.26352609e-03],\n",
       "       [1.99428224e-02, 9.80057178e-01],\n",
       "       [9.92661059e-01, 7.33894126e-03],\n",
       "       [4.70327832e-04, 9.99529672e-01],\n",
       "       [8.00326331e-01, 1.99673669e-01],\n",
       "       [3.52488311e-03, 9.96475117e-01],\n",
       "       [2.31379975e-02, 9.76862003e-01],\n",
       "       [6.03312731e-03, 9.93966873e-01],\n",
       "       [2.95304028e-03, 9.97046960e-01],\n",
       "       [2.95182549e-02, 9.70481745e-01],\n",
       "       [9.99999996e-01, 4.03888249e-09],\n",
       "       [9.99991787e-01, 8.21343984e-06],\n",
       "       [5.95404713e-03, 9.94045953e-01],\n",
       "       [8.00503469e-01, 1.99496531e-01],\n",
       "       [9.90813495e-01, 9.18650455e-03],\n",
       "       [9.99526587e-01, 4.73412905e-04],\n",
       "       [1.80502041e-02, 9.81949796e-01],\n",
       "       [3.25478399e-04, 9.99674522e-01],\n",
       "       [1.15625106e-02, 9.88437489e-01],\n",
       "       [4.40216798e-03, 9.95597832e-01],\n",
       "       [1.68653751e-03, 9.98313462e-01],\n",
       "       [5.00958260e-03, 9.94990417e-01],\n",
       "       [6.74876520e-01, 3.25123480e-01],\n",
       "       [5.16687722e-03, 9.94833123e-01],\n",
       "       [9.88704759e-01, 1.12952415e-02],\n",
       "       [1.35825652e-03, 9.98641743e-01],\n",
       "       [6.29901795e-03, 9.93700982e-01],\n",
       "       [6.53253342e-01, 3.46746658e-01],\n",
       "       [2.95334965e-02, 9.70466504e-01],\n",
       "       [1.00000000e+00, 8.19734916e-19],\n",
       "       [5.28792484e-03, 9.94712075e-01],\n",
       "       [1.05818681e-03, 9.98941813e-01],\n",
       "       [9.99328152e-01, 6.71848079e-04],\n",
       "       [5.23903686e-04, 9.99476096e-01],\n",
       "       [5.37773387e-01, 4.62226613e-01],\n",
       "       [3.51040655e-03, 9.96489593e-01],\n",
       "       [1.52507590e-03, 9.98474924e-01],\n",
       "       [9.99924527e-01, 7.54728649e-05],\n",
       "       [1.11994184e-02, 9.88800582e-01],\n",
       "       [7.06678711e-03, 9.92933213e-01],\n",
       "       [9.77421364e-01, 2.25786364e-02],\n",
       "       [8.26593558e-03, 9.91734064e-01],\n",
       "       [3.38848499e-04, 9.99661152e-01],\n",
       "       [8.20769092e-02, 9.17923091e-01],\n",
       "       [6.87753633e-01, 3.12246367e-01],\n",
       "       [6.17700238e-02, 9.38229976e-01],\n",
       "       [3.08565361e-02, 9.69143464e-01],\n",
       "       [1.65908739e-01, 8.34091261e-01],\n",
       "       [1.24286367e-03, 9.98757136e-01],\n",
       "       [1.81183444e-04, 9.99818817e-01],\n",
       "       [5.16525711e-04, 9.99483474e-01],\n",
       "       [7.40696497e-01, 2.59303503e-01],\n",
       "       [1.00000000e+00, 1.88088748e-10],\n",
       "       [9.96000723e-01, 3.99927675e-03],\n",
       "       [9.90633201e-01, 9.36679870e-03],\n",
       "       [9.99953556e-01, 4.64436388e-05],\n",
       "       [4.85283550e-01, 5.14716450e-01],\n",
       "       [1.01289411e-02, 9.89871059e-01],\n",
       "       [9.99602295e-01, 3.97705050e-04],\n",
       "       [3.38102760e-02, 9.66189724e-01],\n",
       "       [1.05570942e-02, 9.89442906e-01],\n",
       "       [5.27571916e-01, 4.72428084e-01],\n",
       "       [9.94265311e-01, 5.73468861e-03],\n",
       "       [9.71587460e-01, 2.84125402e-02],\n",
       "       [8.96126705e-01, 1.03873295e-01],\n",
       "       [9.87545554e-01, 1.24544457e-02],\n",
       "       [3.93686199e-02, 9.60631380e-01],\n",
       "       [9.99960441e-01, 3.95592674e-05],\n",
       "       [9.58132389e-03, 9.90418676e-01],\n",
       "       [2.13346891e-02, 9.78665311e-01],\n",
       "       [3.11803383e-02, 9.68819662e-01],\n",
       "       [2.15681172e-03, 9.97843188e-01],\n",
       "       [6.43565459e-01, 3.56434541e-01],\n",
       "       [1.39442923e-01, 8.60557077e-01],\n",
       "       [4.10391003e-03, 9.95896090e-01],\n",
       "       [1.32697926e-02, 9.86730207e-01],\n",
       "       [3.29928852e-01, 6.70071148e-01],\n",
       "       [3.08944291e-03, 9.96910557e-01],\n",
       "       [9.40647875e-04, 9.99059352e-01],\n",
       "       [2.21102743e-01, 7.78897257e-01],\n",
       "       [1.54766813e-03, 9.98452332e-01],\n",
       "       [2.43943064e-01, 7.56056936e-01],\n",
       "       [6.17564020e-01, 3.82435980e-01],\n",
       "       [9.69485816e-01, 3.05141844e-02],\n",
       "       [5.29885982e-03, 9.94701140e-01],\n",
       "       [6.37819441e-03, 9.93621806e-01],\n",
       "       [9.99979310e-01, 2.06895301e-05],\n",
       "       [9.94238813e-01, 5.76118665e-03],\n",
       "       [9.88287031e-01, 1.17129687e-02],\n",
       "       [9.84175194e-01, 1.58248062e-02],\n",
       "       [1.81749219e-01, 8.18250781e-01],\n",
       "       [5.24618324e-03, 9.94753817e-01],\n",
       "       [3.78666790e-02, 9.62133321e-01],\n",
       "       [5.84539780e-03, 9.94154602e-01],\n",
       "       [9.99455049e-01, 5.44951202e-04],\n",
       "       [1.40624491e-02, 9.85937551e-01],\n",
       "       [1.55462031e-02, 9.84453797e-01],\n",
       "       [1.80248988e-04, 9.99819751e-01],\n",
       "       [6.43824529e-01, 3.56175471e-01],\n",
       "       [6.59666512e-01, 3.40333488e-01],\n",
       "       [4.83636724e-03, 9.95163633e-01],\n",
       "       [4.11418030e-01, 5.88581970e-01],\n",
       "       [9.99999068e-01, 9.31565481e-07],\n",
       "       [8.04558744e-04, 9.99195441e-01],\n",
       "       [6.01227676e-02, 9.39877232e-01],\n",
       "       [8.84549604e-01, 1.15450396e-01],\n",
       "       [9.99999301e-01, 6.98752458e-07],\n",
       "       [9.99999294e-01, 7.06428488e-07],\n",
       "       [3.01490674e-03, 9.96985093e-01],\n",
       "       [5.97575353e-01, 4.02424647e-01],\n",
       "       [9.92520948e-01, 7.47905165e-03],\n",
       "       [8.23304351e-03, 9.91766956e-01],\n",
       "       [2.06356738e-02, 9.79364326e-01],\n",
       "       [1.05008069e-01, 8.94991931e-01],\n",
       "       [8.07774288e-02, 9.19222571e-01],\n",
       "       [9.57328559e-01, 4.26714412e-02],\n",
       "       [5.15528548e-01, 4.84471452e-01],\n",
       "       [1.69054727e-02, 9.83094527e-01],\n",
       "       [3.10002298e-02, 9.68999770e-01],\n",
       "       [9.99973186e-01, 2.68140667e-05],\n",
       "       [9.82589682e-01, 1.74103180e-02],\n",
       "       [9.98471911e-01, 1.52808857e-03],\n",
       "       [3.60292341e-02, 9.63970766e-01],\n",
       "       [1.47705417e-04, 9.99852295e-01],\n",
       "       [9.60236649e-03, 9.90397634e-01],\n",
       "       [2.37971611e-04, 9.99762028e-01],\n",
       "       [1.69508977e-03, 9.98304910e-01],\n",
       "       [9.90080326e-01, 9.91967376e-03],\n",
       "       [3.32291810e-02, 9.66770819e-01],\n",
       "       [1.00000000e+00, 4.70754641e-27],\n",
       "       [3.09776351e-03, 9.96902236e-01],\n",
       "       [3.16876537e-01, 6.83123463e-01],\n",
       "       [1.01380916e-03, 9.98986191e-01],\n",
       "       [1.19200623e-02, 9.88079938e-01],\n",
       "       [2.63223025e-01, 7.36776975e-01],\n",
       "       [9.60954324e-01, 3.90456758e-02],\n",
       "       [1.00000000e+00, 1.73994783e-14],\n",
       "       [2.57097379e-01, 7.42902621e-01],\n",
       "       [4.10103636e-04, 9.99589896e-01],\n",
       "       [9.99984056e-01, 1.59440609e-05],\n",
       "       [1.55199934e-04, 9.99844800e-01],\n",
       "       [9.72463616e-01, 2.75363837e-02],\n",
       "       [8.32683449e-01, 1.67316551e-01],\n",
       "       [6.88588609e-02, 9.31141139e-01],\n",
       "       [8.78514839e-01, 1.21485161e-01],\n",
       "       [5.37036536e-03, 9.94629635e-01],\n",
       "       [4.91932622e-03, 9.95080674e-01],\n",
       "       [4.55361436e-03, 9.95446386e-01],\n",
       "       [9.98666802e-01, 1.33319812e-03],\n",
       "       [4.23443798e-03, 9.95765562e-01],\n",
       "       [8.64468269e-02, 9.13553173e-01],\n",
       "       [5.16262177e-02, 9.48373782e-01],\n",
       "       [9.99943303e-01, 5.66971558e-05],\n",
       "       [7.02903957e-02, 9.29709604e-01],\n",
       "       [2.07249286e-03, 9.97927507e-01],\n",
       "       [1.45138940e-02, 9.85486106e-01],\n",
       "       [9.95334199e-01, 4.66580103e-03],\n",
       "       [6.38119767e-03, 9.93618802e-01],\n",
       "       [6.78070692e-03, 9.93219293e-01],\n",
       "       [9.93770721e-01, 6.22927945e-03],\n",
       "       [8.83448139e-01, 1.16551861e-01],\n",
       "       [1.71801578e-01, 8.28198422e-01],\n",
       "       [9.99959687e-01, 4.03130400e-05],\n",
       "       [2.03252034e-03, 9.97967480e-01],\n",
       "       [2.49284545e-02, 9.75071545e-01],\n",
       "       [9.99988739e-01, 1.12612746e-05],\n",
       "       [9.99999999e-01, 6.36269982e-10],\n",
       "       [3.97353234e-03, 9.96026468e-01],\n",
       "       [6.25517641e-01, 3.74482359e-01],\n",
       "       [9.54439657e-03, 9.90455603e-01],\n",
       "       [9.68571562e-01, 3.14284376e-02],\n",
       "       [4.67051943e-01, 5.32948057e-01],\n",
       "       [1.54343946e-02, 9.84565605e-01],\n",
       "       [6.40611075e-01, 3.59388925e-01],\n",
       "       [1.16457860e-01, 8.83542140e-01],\n",
       "       [7.47579135e-01, 2.52420865e-01],\n",
       "       [8.90843151e-01, 1.09156849e-01],\n",
       "       [2.34943753e-02, 9.76505625e-01],\n",
       "       [1.91523201e-02, 9.80847680e-01],\n",
       "       [1.06662455e-02, 9.89333755e-01],\n",
       "       [4.79389717e-03, 9.95206103e-01],\n",
       "       [9.99959194e-01, 4.08057776e-05],\n",
       "       [2.82905704e-02, 9.71709430e-01],\n",
       "       [7.58478611e-03, 9.92415214e-01],\n",
       "       [5.03110748e-01, 4.96889252e-01],\n",
       "       [9.91342445e-01, 8.65755452e-03],\n",
       "       [3.63215301e-01, 6.36784699e-01],\n",
       "       [1.34008507e-01, 8.65991493e-01],\n",
       "       [2.53797181e-03, 9.97462028e-01],\n",
       "       [1.41166041e-02, 9.85883396e-01],\n",
       "       [9.34336003e-03, 9.90656640e-01],\n",
       "       [6.23524671e-01, 3.76475329e-01],\n",
       "       [1.21313954e-02, 9.87868605e-01],\n",
       "       [4.66269227e-03, 9.95337308e-01],\n",
       "       [9.98941359e-01, 1.05864061e-03],\n",
       "       [3.91133193e-03, 9.96088668e-01],\n",
       "       [9.64528180e-01, 3.54718198e-02],\n",
       "       [2.64845202e-01, 7.35154798e-01],\n",
       "       [2.65624149e-03, 9.97343759e-01],\n",
       "       [1.14951167e-02, 9.88504883e-01],\n",
       "       [9.31252660e-03, 9.90687473e-01],\n",
       "       [9.91882426e-01, 8.11757448e-03],\n",
       "       [7.76970656e-03, 9.92230293e-01],\n",
       "       [9.98928915e-01, 1.07108468e-03],\n",
       "       [2.09658797e-01, 7.90341203e-01],\n",
       "       [9.35018337e-02, 9.06498166e-01],\n",
       "       [9.94967336e-01, 5.03266409e-03],\n",
       "       [1.64071145e-01, 8.35928855e-01],\n",
       "       [5.85358138e-01, 4.14641862e-01],\n",
       "       [9.42996594e-01, 5.70034061e-02],\n",
       "       [9.97332744e-01, 2.66725557e-03],\n",
       "       [3.12055651e-03, 9.96879443e-01],\n",
       "       [2.87464575e-03, 9.97125354e-01],\n",
       "       [2.72195002e-01, 7.27804998e-01],\n",
       "       [2.32573586e-01, 7.67426414e-01],\n",
       "       [9.59822534e-02, 9.04017747e-01],\n",
       "       [8.48899088e-04, 9.99151101e-01],\n",
       "       [9.99968969e-01, 3.10311791e-05],\n",
       "       [2.19335881e-03, 9.97806641e-01],\n",
       "       [3.50020075e-03, 9.96499799e-01],\n",
       "       [3.60861462e-02, 9.63913854e-01],\n",
       "       [9.75027744e-01, 2.49722561e-02],\n",
       "       [1.70533363e-03, 9.98294666e-01],\n",
       "       [2.40099461e-02, 9.75990054e-01],\n",
       "       [1.50701058e-03, 9.98492989e-01],\n",
       "       [8.05051082e-03, 9.91949489e-01],\n",
       "       [4.39923337e-03, 9.95600767e-01],\n",
       "       [9.99999970e-01, 3.02245465e-08],\n",
       "       [2.63406190e-02, 9.73659381e-01],\n",
       "       [8.32147940e-01, 1.67852060e-01],\n",
       "       [2.01301354e-02, 9.79869865e-01],\n",
       "       [1.87622292e-02, 9.81237771e-01],\n",
       "       [2.17779396e-02, 9.78222060e-01],\n",
       "       [1.74068207e-03, 9.98259318e-01],\n",
       "       [9.99998160e-01, 1.84015759e-06],\n",
       "       [2.73786705e-02, 9.72621329e-01],\n",
       "       [3.62116223e-01, 6.37883777e-01],\n",
       "       [1.25703514e-01, 8.74296486e-01],\n",
       "       [3.29771626e-01, 6.70228374e-01],\n",
       "       [9.45993812e-01, 5.40061876e-02],\n",
       "       [2.19995461e-01, 7.80004539e-01],\n",
       "       [9.99994122e-01, 5.87815420e-06],\n",
       "       [1.98010313e-01, 8.01989687e-01],\n",
       "       [8.72676448e-01, 1.27323552e-01],\n",
       "       [8.07778449e-02, 9.19222155e-01],\n",
       "       [2.04526431e-02, 9.79547357e-01],\n",
       "       [9.99734121e-01, 2.65878615e-04],\n",
       "       [1.47596765e-02, 9.85240324e-01],\n",
       "       [1.54192402e-02, 9.84580760e-01],\n",
       "       [2.97839198e-01, 7.02160802e-01],\n",
       "       [9.99992788e-01, 7.21201245e-06],\n",
       "       [2.67163454e-02, 9.73283655e-01],\n",
       "       [9.99557850e-01, 4.42149633e-04],\n",
       "       [9.57100494e-02, 9.04289951e-01],\n",
       "       [6.01742451e-01, 3.98257549e-01],\n",
       "       [9.45157405e-03, 9.90548426e-01],\n",
       "       [1.43647189e-03, 9.98563528e-01],\n",
       "       [8.67173514e-01, 1.32826486e-01],\n",
       "       [9.88869694e-01, 1.11303064e-02],\n",
       "       [9.99508088e-01, 4.91911779e-04],\n",
       "       [8.80430886e-03, 9.91195691e-01],\n",
       "       [3.28811227e-02, 9.67118877e-01],\n",
       "       [2.24606718e-01, 7.75393282e-01],\n",
       "       [4.16407593e-02, 9.58359241e-01],\n",
       "       [9.99999999e-01, 5.46438375e-10],\n",
       "       [1.08805007e-01, 8.91194993e-01],\n",
       "       [6.53339481e-01, 3.46660519e-01],\n",
       "       [1.24754410e-02, 9.87524559e-01],\n",
       "       [9.41300013e-01, 5.86999868e-02],\n",
       "       [3.18789725e-03, 9.96812103e-01],\n",
       "       [7.75867972e-02, 9.22413203e-01],\n",
       "       [2.26373284e-02, 9.77362672e-01],\n",
       "       [1.97985525e-03, 9.98020145e-01],\n",
       "       [6.69815833e-01, 3.30184167e-01],\n",
       "       [1.00000000e+00, 2.23475825e-10],\n",
       "       [3.90358876e-02, 9.60964112e-01],\n",
       "       [9.84726373e-01, 1.52736270e-02],\n",
       "       [3.61931746e-01, 6.38068254e-01],\n",
       "       [3.17485545e-02, 9.68251446e-01],\n",
       "       [3.85587230e-03, 9.96144128e-01],\n",
       "       [8.46736114e-02, 9.15326389e-01],\n",
       "       [3.91630845e-01, 6.08369155e-01],\n",
       "       [9.99630657e-01, 3.69343315e-04],\n",
       "       [9.99999662e-01, 3.37596266e-07],\n",
       "       [4.23679771e-03, 9.95763202e-01],\n",
       "       [9.96019739e-01, 3.98026135e-03],\n",
       "       [8.92051103e-01, 1.07948897e-01],\n",
       "       [4.02243327e-01, 5.97756673e-01],\n",
       "       [3.04606129e-03, 9.96953939e-01],\n",
       "       [3.85413607e-03, 9.96145864e-01],\n",
       "       [1.91006056e-02, 9.80899394e-01],\n",
       "       [9.96169043e-01, 3.83095735e-03],\n",
       "       [2.97279406e-02, 9.70272059e-01],\n",
       "       [1.00419977e-03, 9.98995800e-01],\n",
       "       [5.97108276e-02, 9.40289172e-01],\n",
       "       [1.21434161e-03, 9.98785658e-01],\n",
       "       [1.30345635e-02, 9.86965437e-01],\n",
       "       [1.47311338e-02, 9.85268866e-01],\n",
       "       [9.95199423e-01, 4.80057658e-03],\n",
       "       [9.99493397e-01, 5.06603183e-04],\n",
       "       [2.98234802e-03, 9.97017652e-01],\n",
       "       [9.04412068e-01, 9.55879317e-02],\n",
       "       [1.81725003e-02, 9.81827500e-01],\n",
       "       [2.95276137e-02, 9.70472386e-01],\n",
       "       [5.44533506e-03, 9.94554665e-01],\n",
       "       [1.83587354e-01, 8.16412646e-01],\n",
       "       [1.51945881e-01, 8.48054119e-01],\n",
       "       [2.44278776e-02, 9.75572122e-01],\n",
       "       [6.18576704e-01, 3.81423296e-01],\n",
       "       [1.94926482e-03, 9.98050735e-01],\n",
       "       [7.28746028e-01, 2.71253972e-01],\n",
       "       [8.66068662e-03, 9.91339313e-01],\n",
       "       [9.79553193e-01, 2.04468066e-02],\n",
       "       [6.35588253e-03, 9.93644117e-01],\n",
       "       [9.96055875e-01, 3.94412510e-03],\n",
       "       [1.47502729e-03, 9.98524973e-01],\n",
       "       [7.94975702e-03, 9.92050243e-01],\n",
       "       [1.09539458e-02, 9.89046054e-01],\n",
       "       [3.39481860e-02, 9.66051814e-01],\n",
       "       [1.09689742e-01, 8.90310258e-01],\n",
       "       [1.81902524e-02, 9.81809748e-01],\n",
       "       [4.13881398e-03, 9.95861186e-01],\n",
       "       [9.87168964e-01, 1.28310358e-02],\n",
       "       [1.12747321e-03, 9.98872527e-01],\n",
       "       [9.99964685e-01, 3.53149536e-05],\n",
       "       [6.55292762e-04, 9.99344707e-01],\n",
       "       [3.23095005e-03, 9.96769050e-01],\n",
       "       [2.45513806e-04, 9.99754486e-01],\n",
       "       [4.85005855e-03, 9.95149941e-01],\n",
       "       [2.96697615e-01, 7.03302385e-01],\n",
       "       [2.35357447e-03, 9.97646426e-01],\n",
       "       [3.45224956e-01, 6.54775044e-01],\n",
       "       [3.83644770e-03, 9.96163552e-01],\n",
       "       [1.17970881e-02, 9.88202912e-01],\n",
       "       [6.58860119e-03, 9.93411399e-01],\n",
       "       [1.22690164e-01, 8.77309836e-01],\n",
       "       [4.98342126e-01, 5.01657874e-01],\n",
       "       [9.53130019e-01, 4.68699815e-02],\n",
       "       [2.60817797e-03, 9.97391822e-01],\n",
       "       [9.18390328e-01, 8.16096720e-02],\n",
       "       [1.96014019e-01, 8.03985981e-01],\n",
       "       [3.32015723e-02, 9.66798428e-01],\n",
       "       [3.16121657e-03, 9.96838783e-01],\n",
       "       [3.75924259e-01, 6.24075741e-01],\n",
       "       [6.49021019e-04, 9.99350979e-01],\n",
       "       [1.15928305e-03, 9.98840717e-01],\n",
       "       [9.90522965e-01, 9.47703467e-03],\n",
       "       [9.98459148e-01, 1.54085188e-03],\n",
       "       [1.22084361e-02, 9.87791564e-01],\n",
       "       [6.17653624e-02, 9.38234638e-01],\n",
       "       [9.92861983e-01, 7.13801723e-03],\n",
       "       [9.95328874e-01, 4.67112554e-03],\n",
       "       [4.98357394e-02, 9.50164261e-01],\n",
       "       [9.99742904e-01, 2.57095599e-04],\n",
       "       [6.17106878e-03, 9.93828931e-01],\n",
       "       [8.60176079e-01, 1.39823921e-01],\n",
       "       [9.96097322e-01, 3.90267751e-03],\n",
       "       [9.99999269e-01, 7.31054492e-07],\n",
       "       [9.99601934e-01, 3.98066497e-04],\n",
       "       [9.99999988e-01, 1.15738569e-08],\n",
       "       [1.74797640e-02, 9.82520236e-01],\n",
       "       [3.99837687e-03, 9.96001623e-01],\n",
       "       [2.47783944e-03, 9.97522161e-01],\n",
       "       [8.91170030e-01, 1.08829970e-01],\n",
       "       [1.42642640e-03, 9.98573574e-01],\n",
       "       [2.22108510e-03, 9.97778915e-01],\n",
       "       [7.97096315e-01, 2.02903685e-01],\n",
       "       [8.20299452e-01, 1.79700548e-01],\n",
       "       [1.57308241e-01, 8.42691759e-01],\n",
       "       [4.43545779e-01, 5.56454221e-01],\n",
       "       [8.83132019e-01, 1.16867981e-01],\n",
       "       [1.33291743e-02, 9.86670826e-01],\n",
       "       [5.48615133e-02, 9.45138487e-01],\n",
       "       [2.37279861e-03, 9.97627201e-01],\n",
       "       [1.77778998e-02, 9.82222100e-01],\n",
       "       [1.05024745e-02, 9.89497525e-01],\n",
       "       [2.27185196e-03, 9.97728148e-01],\n",
       "       [9.85012433e-01, 1.49875666e-02],\n",
       "       [9.99995992e-01, 4.00785593e-06],\n",
       "       [7.46736182e-04, 9.99253264e-01],\n",
       "       [2.44054092e-04, 9.99755946e-01],\n",
       "       [4.86621206e-04, 9.99513379e-01],\n",
       "       [8.27172664e-01, 1.72827336e-01],\n",
       "       [3.81420206e-03, 9.96185798e-01],\n",
       "       [4.18357081e-02, 9.58164292e-01],\n",
       "       [2.02096885e-02, 9.79790312e-01],\n",
       "       [4.12061185e-03, 9.95879388e-01],\n",
       "       [9.99999999e-01, 1.19734488e-09],\n",
       "       [4.21151622e-03, 9.95788484e-01],\n",
       "       [9.91773319e-01, 8.22668058e-03],\n",
       "       [5.08438895e-02, 9.49156111e-01],\n",
       "       [3.57688339e-02, 9.64231166e-01],\n",
       "       [1.84947191e-02, 9.81505281e-01],\n",
       "       [3.02091481e-03, 9.96979085e-01],\n",
       "       [9.97898506e-01, 2.10149364e-03],\n",
       "       [1.42370930e-02, 9.85762907e-01],\n",
       "       [4.36500622e-02, 9.56349938e-01],\n",
       "       [9.99995046e-01, 4.95395495e-06],\n",
       "       [1.54843556e-03, 9.98451564e-01],\n",
       "       [2.46729709e-03, 9.97532703e-01],\n",
       "       [5.02717126e-03, 9.94972829e-01],\n",
       "       [3.52991436e-02, 9.64700856e-01],\n",
       "       [2.45026544e-03, 9.97549735e-01],\n",
       "       [9.68264364e-01, 3.17356356e-02],\n",
       "       [3.66790710e-02, 9.63320929e-01],\n",
       "       [9.99999786e-01, 2.13848378e-07],\n",
       "       [1.00000000e+00, 5.40780873e-12],\n",
       "       [9.99745024e-01, 2.54976468e-04],\n",
       "       [4.45443077e-01, 5.54556923e-01],\n",
       "       [9.87771945e-01, 1.22280552e-02],\n",
       "       [9.93121374e-01, 6.87862589e-03],\n",
       "       [9.99913717e-01, 8.62825180e-05],\n",
       "       [7.86555800e-03, 9.92134442e-01],\n",
       "       [8.94322221e-01, 1.05677779e-01],\n",
       "       [5.52922436e-01, 4.47077564e-01],\n",
       "       [9.11558385e-01, 8.84416146e-02],\n",
       "       [9.99988356e-01, 1.16444580e-05],\n",
       "       [7.33991208e-02, 9.26600879e-01],\n",
       "       [4.73849049e-02, 9.52615095e-01],\n",
       "       [2.65133694e-02, 9.73486631e-01],\n",
       "       [7.51815776e-03, 9.92481842e-01],\n",
       "       [2.60764852e-03, 9.97392351e-01],\n",
       "       [1.93787940e-02, 9.80621206e-01],\n",
       "       [4.94263752e-01, 5.05736248e-01],\n",
       "       [9.99979931e-01, 2.00689830e-05],\n",
       "       [3.49786120e-03, 9.96502139e-01],\n",
       "       [9.99999998e-01, 2.37677777e-09],\n",
       "       [8.96358492e-01, 1.03641508e-01],\n",
       "       [6.00912379e-03, 9.93990876e-01],\n",
       "       [2.46875597e-01, 7.53124403e-01],\n",
       "       [4.91750392e-01, 5.08249608e-01],\n",
       "       [1.17318164e-03, 9.98826818e-01],\n",
       "       [2.39357819e-03, 9.97606422e-01],\n",
       "       [3.53052856e-03, 9.96469471e-01],\n",
       "       [1.88966840e-03, 9.98110332e-01],\n",
       "       [4.24334563e-02, 9.57566544e-01],\n",
       "       [1.07983264e-01, 8.92016736e-01],\n",
       "       [5.13053545e-03, 9.94869465e-01],\n",
       "       [3.87991800e-03, 9.96120082e-01],\n",
       "       [9.99999191e-01, 8.09416344e-07],\n",
       "       [7.19455753e-03, 9.92805442e-01],\n",
       "       [4.73934898e-03, 9.95260651e-01],\n",
       "       [1.94903736e-03, 9.98050963e-01],\n",
       "       [9.33844471e-01, 6.61555290e-02],\n",
       "       [8.16855134e-04, 9.99183145e-01],\n",
       "       [9.73616740e-04, 9.99026383e-01],\n",
       "       [3.80410035e-01, 6.19589965e-01],\n",
       "       [2.02953312e-02, 9.79704669e-01]])"
      ]
     },
     "execution_count": 88,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "gnb=GaussianNB()\n",
    "gnb_probility_test = np.array([[.0, .0]])\n",
    "for train, test in kf.split(X_y_train):\n",
    "    df_base_train = X_y_train.iloc[train]\n",
    "    df_base_test = X_y_train.iloc[test]\n",
    "    X_base_train = df_base_train.drop(columns=['benign'])\n",
    "    y_base_train = df_base_train['benign']\n",
    "    X_base_test = df_base_test.drop(columns=['benign'])\n",
    "    y_base_test = df_base_test['benign']\n",
    "    gnb.fit(X_base_train, y_base_train)\n",
    "    gnb_probility_test = np.concatenate((gnb_probility_test, gnb.predict_proba(X_base_test)), axis=0)\n",
    "\n",
    "gnb_probility_test = np.delete(gnb_probility_test, 0, axis = 0)\n",
    "gnb_probility_test"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 89,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>0</th>\n",
       "      <th>1</th>\n",
       "      <th>entropy</th>\n",
       "      <th>benign</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0.005350</td>\n",
       "      <td>0.994650</td>\n",
       "      <td>0.033318</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0.000177</td>\n",
       "      <td>0.999823</td>\n",
       "      <td>0.001704</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0.999805</td>\n",
       "      <td>0.000195</td>\n",
       "      <td>0.001862</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0.000983</td>\n",
       "      <td>0.999017</td>\n",
       "      <td>0.007790</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0.116580</td>\n",
       "      <td>0.883420</td>\n",
       "      <td>0.360055</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>450</th>\n",
       "      <td>0.933844</td>\n",
       "      <td>0.066156</td>\n",
       "      <td>0.243579</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>451</th>\n",
       "      <td>0.000817</td>\n",
       "      <td>0.999183</td>\n",
       "      <td>0.006624</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>452</th>\n",
       "      <td>0.000974</td>\n",
       "      <td>0.999026</td>\n",
       "      <td>0.007725</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>453</th>\n",
       "      <td>0.380410</td>\n",
       "      <td>0.619590</td>\n",
       "      <td>0.664265</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>454</th>\n",
       "      <td>0.020295</td>\n",
       "      <td>0.979705</td>\n",
       "      <td>0.099186</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>455 rows × 4 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "            0         1   entropy  benign\n",
       "0    0.005350  0.994650  0.033318       1\n",
       "1    0.000177  0.999823  0.001704       1\n",
       "2    0.999805  0.000195  0.001862       0\n",
       "3    0.000983  0.999017  0.007790       1\n",
       "4    0.116580  0.883420  0.360055       1\n",
       "..        ...       ...       ...     ...\n",
       "450  0.933844  0.066156  0.243579       0\n",
       "451  0.000817  0.999183  0.006624       1\n",
       "452  0.000974  0.999026  0.007725       1\n",
       "453  0.380410  0.619590  0.664265       0\n",
       "454  0.020295  0.979705  0.099186       1\n",
       "\n",
       "[455 rows x 4 columns]"
      ]
     },
     "execution_count": 89,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_gnb_probility_test = insert_entropy(gnb_probility_test)\n",
    "df_gnb_probility_test.insert(loc=len(df_gnb_probility_test.columns), column='benign', value=knn_y_test['benign'].values)\n",
    "df_gnb_probility_test.to_csv('gnb_probility_test.csv')\n",
    "df_gnb_probility_test"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 90,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 计算 Loss (三个基分类器kNN、LDA、GN)\n",
    "import math\n",
    "\n",
    "def loss(alpha):\n",
    "    if alpha[0] < 0 or alpha[1] < 0 or alpha[2] < 0 or alpha[0] > math.log(2) or alpha[1] > math.log(2) or alpha[2] > math.log(2):\n",
    "        return 100.0\n",
    "    classifier_1 = pd.read_csv(\"knn_probility_test.csv\", sep=',', index_col=0)\n",
    "    classifier_2 = pd.read_csv(\"lda_probility_test.csv\", sep=',', index_col=0)\n",
    "    classifier_3 = pd.read_csv(\"gnb_probility_test.csv\", sep=',', index_col=0)\n",
    "    N = len(classifier_1)\n",
    "    l = .0\n",
    "    for i in range(N):\n",
    "        a = .0\n",
    "        b = .0\n",
    "        if (classifier_1.iloc[i][2] < alpha[0]):\n",
    "            a = a + classifier_1.iloc[i][0]\n",
    "            b = b + classifier_1.iloc[i][1]\n",
    "        if (classifier_2.iloc[i][2] < alpha[1]):\n",
    "            a = a + classifier_2.iloc[i][0]\n",
    "            b = b + classifier_2.iloc[i][1]\n",
    "        if (classifier_3.iloc[i][2] < alpha[2]):\n",
    "            a = a + classifier_3.iloc[i][0]\n",
    "            b = b + classifier_3.iloc[i][1]\n",
    "        if a < b:\n",
    "            y_predict = 1\n",
    "        else:\n",
    "            y_predict = 0\n",
    "\n",
    "        benign = classifier_1.iloc[i][3]\n",
    "        l += float(benign != y_predict)\n",
    "\n",
    "    l /= float(N)\n",
    "\n",
    "    return l\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 91,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.1010989010989011"
      ]
     },
     "execution_count": 91,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "l = loss([math.log(2) , 0, math.log(2)])\n",
    "l"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 92,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Iteration 0: Best Cost = 0.0945054945054945\n",
      "Iteration 1: Best Cost = 0.0945054945054945\n",
      "Iteration 2: Best Cost = 0.0945054945054945\n",
      "Iteration 3: Best Cost = 0.09010989010989011\n",
      "Iteration 4: Best Cost = 0.09010989010989011\n",
      "Iteration 5: Best Cost = 0.08791208791208792\n",
      "Iteration 6: Best Cost = 0.08791208791208792\n",
      "Iteration 7: Best Cost = 0.08791208791208792\n",
      "Iteration 8: Best Cost = 0.08791208791208792\n",
      "Iteration 9: Best Cost = 0.08791208791208792\n",
      "Iteration 10: Best Cost = 0.08791208791208792\n",
      "Iteration 11: Best Cost = 0.08791208791208792\n",
      "Iteration 12: Best Cost = 0.08791208791208792\n",
      "Iteration 13: Best Cost = 0.08791208791208792\n",
      "Iteration 14: Best Cost = 0.08791208791208792\n",
      "Iteration 15: Best Cost = 0.08791208791208792\n",
      "Iteration 16: Best Cost = 0.08791208791208792\n",
      "Iteration 17: Best Cost = 0.08791208791208792\n",
      "Iteration 18: Best Cost = 0.08791208791208792\n",
      "Iteration 19: Best Cost = 0.08791208791208792\n",
      "Iteration 20: Best Cost = 0.08791208791208792\n",
      "Iteration 21: Best Cost = 0.08791208791208792\n",
      "Iteration 22: Best Cost = 0.08791208791208792\n",
      "Iteration 23: Best Cost = 0.08791208791208792\n",
      "Iteration 24: Best Cost = 0.08791208791208792\n",
      "Iteration 25: Best Cost = 0.08791208791208792\n",
      "Iteration 26: Best Cost = 0.08791208791208792\n",
      "Iteration 27: Best Cost = 0.08791208791208792\n",
      "Iteration 28: Best Cost = 0.08791208791208792\n",
      "Iteration 29: Best Cost = 0.08791208791208792\n",
      "Iteration 30: Best Cost = 0.08791208791208792\n",
      "Iteration 31: Best Cost = 0.08791208791208792\n",
      "Iteration 32: Best Cost = 0.08791208791208792\n",
      "Iteration 33: Best Cost = 0.08791208791208792\n",
      "Iteration 34: Best Cost = 0.08791208791208792\n",
      "Iteration 35: Best Cost = 0.08791208791208792\n",
      "Iteration 36: Best Cost = 0.08791208791208792\n",
      "Iteration 37: Best Cost = 0.08791208791208792\n",
      "Iteration 38: Best Cost = 0.08791208791208792\n",
      "Iteration 39: Best Cost = 0.08791208791208792\n",
      "最优解：struct({'position': array([0.56035187, 0.64856736, 0.19046707]), 'cost': 0.08791208791208792})\n",
      "运行时间：593.5831515789032s\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAY8AAAESCAYAAAAFYll6AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cG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>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "import numpy as np\n",
    "from ypstruct import structure\n",
    "import time\n",
    "import math\n",
    "import artificial_bee_colony\n",
    "\n",
    "start = time.time()         #运行开始时刻\n",
    "\n",
    "# 问题定义\n",
    "problem = structure()\n",
    "problem.costfunc = loss\n",
    "problem.nvar = 3\n",
    "problem.varmin = .0 * np.ones(3)\n",
    "problem.varmax = math.log(2) * np.ones(3)\n",
    "\n",
    "# ABC参数\n",
    "params = structure()\n",
    "params.maxit = 40\n",
    "params.npop = 50\n",
    "params.nonlooker = 100\n",
    "params.a = 1\n",
    "\n",
    "# 运行ABC\n",
    "out = artificial_bee_colony.run(problem, params)\n",
    "# 运行结果\n",
    "plt.rcParams['font.sans-serif'] = ['KaiTi']  #设置字体为楷体\n",
    "plt.plot(out.bestcost)\n",
    "print(\"最优解：{}\".format(out.bestsol))\n",
    "end = time.time()              # 运行结束时刻\n",
    "print('运行时间：{}s'.format(end-start))\n",
    "\n",
    "plt.xlim(0, params.maxit)\n",
    "plt.xlabel('迭代次数')\n",
    "plt.ylabel('全局最优目标函数值')\n",
    "plt.title('人工蜂群算法')\n",
    "plt.grid(True)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 93,
   "metadata": {},
   "outputs": [],
   "source": [
    "alpha = out['bestsol']['position']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 94,
   "metadata": {},
   "outputs": [],
   "source": [
    "# alpha = [0.67548542, 0.43867688, 0.00332863]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 95,
   "metadata": {},
   "outputs": [],
   "source": [
    "knn_test = knn.predict_proba(X_test)\n",
    "lda_test = lda.predict_proba(X_test)\n",
    "gnb_test = gnb.predict_proba(X_test)\n",
    "\n",
    "df_knn_test = insert_entropy(knn_test)\n",
    "df_lda_test = insert_entropy(lda_test)\n",
    "df_gnb_test = insert_entropy(gnb_test)\n",
    "\n",
    "df_y_predict = pd.DataFrame(data=[], columns=['y_predict'])\n",
    "df_y_predict['y_test'] = y_test.values\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 96,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>y_predict</th>\n",
       "      <th>y_test</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>109</th>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>110</th>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>111</th>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>112</th>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>113</th>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>114 rows × 2 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "    y_predict  y_test\n",
       "0         NaN       0\n",
       "1         NaN       1\n",
       "2         NaN       1\n",
       "3         NaN       0\n",
       "4         NaN       1\n",
       "..        ...     ...\n",
       "109       NaN       0\n",
       "110       NaN       0\n",
       "111       NaN       0\n",
       "112       NaN       1\n",
       "113       NaN       1\n",
       "\n",
       "[114 rows x 2 columns]"
      ]
     },
     "execution_count": 96,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_y_predict"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 97,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>0</th>\n",
       "      <th>1</th>\n",
       "      <th>entropy</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0.859623</td>\n",
       "      <td>1.403772e-01</td>\n",
       "      <td>0.405648</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0.107398</td>\n",
       "      <td>8.926022e-01</td>\n",
       "      <td>0.341040</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0.565849</td>\n",
       "      <td>4.341510e-01</td>\n",
       "      <td>0.684450</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0.999952</td>\n",
       "      <td>4.814764e-05</td>\n",
       "      <td>0.000527</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0.003428</td>\n",
       "      <td>9.965720e-01</td>\n",
       "      <td>0.022879</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>109</th>\n",
       "      <td>0.998261</td>\n",
       "      <td>1.739053e-03</td>\n",
       "      <td>0.012788</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>110</th>\n",
       "      <td>0.996326</td>\n",
       "      <td>3.674157e-03</td>\n",
       "      <td>0.024266</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>111</th>\n",
       "      <td>0.999999</td>\n",
       "      <td>9.137601e-07</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>112</th>\n",
       "      <td>0.002876</td>\n",
       "      <td>9.971236e-01</td>\n",
       "      <td>0.019702</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>113</th>\n",
       "      <td>0.015623</td>\n",
       "      <td>9.843769e-01</td>\n",
       "      <td>0.080477</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>114 rows × 3 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "            0             1   entropy\n",
       "0    0.859623  1.403772e-01  0.405648\n",
       "1    0.107398  8.926022e-01  0.341040\n",
       "2    0.565849  4.341510e-01  0.684450\n",
       "3    0.999952  4.814764e-05  0.000527\n",
       "4    0.003428  9.965720e-01  0.022879\n",
       "..        ...           ...       ...\n",
       "109  0.998261  1.739053e-03  0.012788\n",
       "110  0.996326  3.674157e-03  0.024266\n",
       "111  0.999999  9.137601e-07  0.000000\n",
       "112  0.002876  9.971236e-01  0.019702\n",
       "113  0.015623  9.843769e-01  0.080477\n",
       "\n",
       "[114 rows x 3 columns]"
      ]
     },
     "execution_count": 97,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_gnb_test"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 98,
   "metadata": {},
   "outputs": [],
   "source": [
    "\n",
    "\n",
    "N = len(df_knn_test)\n",
    "for i in range(N):\n",
    "    a = .0\n",
    "    b = .0\n",
    "    if (df_knn_test.iloc[i]['entropy'] < alpha[0]):\n",
    "        a = a + df_knn_test.iloc[i][0]\n",
    "        b = b + df_knn_test.iloc[i][1]\n",
    "    if (df_lda_test.iloc[i]['entropy'] < alpha[1]):\n",
    "        a = a + df_lda_test.iloc[i][0]\n",
    "        b = b + df_lda_test.iloc[i][1]\n",
    "    if (df_gnb_test.iloc[i]['entropy'] < alpha[2]):\n",
    "        a = a + df_gnb_test.iloc[i][0]\n",
    "        b = b + df_gnb_test.iloc[i][1]\n",
    "    if a < b:\n",
    "        df_y_predict.at[i, 'y_predict'] = 1\n",
    "    else:\n",
    "        df_y_predict.at[i, 'y_predict'] = 0\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 99,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>y_predict</th>\n",
       "      <th>y_test</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>109</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>110</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>111</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>112</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>113</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>114 rows × 2 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "    y_predict  y_test\n",
       "0           0       0\n",
       "1           1       1\n",
       "2           1       1\n",
       "3           0       0\n",
       "4           1       1\n",
       "..        ...     ...\n",
       "109         0       0\n",
       "110         0       0\n",
       "111         0       0\n",
       "112         1       1\n",
       "113         1       1\n",
       "\n",
       "[114 rows x 2 columns]"
      ]
     },
     "execution_count": 99,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_y_predict"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 100,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.9298245614035088"
      ]
     },
     "execution_count": 100,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "count = 0\n",
    "for i in range(N):\n",
    "    if df_y_predict.iloc[i][0] == df_y_predict.iloc[i][1]:\n",
    "        count += 1\n",
    "\n",
    "float(count) / float(N)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 101,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "knn: 0.9298245614035088\n",
      "lda: 0.6491228070175439\n",
      "gnb: 0.9035087719298246\n"
     ]
    }
   ],
   "source": [
    "# test the three models with the test data and print their accuracy scores\n",
    "\n",
    "print('knn: {}'.format(knn.score(X_test, y_test)))\n",
    "print('lda: {}'.format(lda.score(X_test, y_test)))\n",
    "print('gnb: {}'.format(gnb.score(X_test, y_test)))\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 103,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.9298245614035088"
      ]
     },
     "execution_count": 103,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#create a dictionary of our models\n",
    "estimators=[('knn', knn), ('lda', lda), ('gnb', gnb)]\n",
    "\n",
    "#create our voting classifier, inputting our models\n",
    "ensemble = VotingClassifier(estimators, voting='hard')\n",
    "\n",
    "#fit model to training data\n",
    "ensemble.fit(X_train, y_train)\n",
    "\n",
    "#test our model on the test data\n",
    "ensemble.score(X_test, y_test)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3.9.7 ('base')",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.7"
  },
  "vscode": {
   "interpreter": {
    "hash": "b09ec625f77bf4fd762565a912b97636504ad6ec901eb2d0f4cf5a7de23e1ee5"
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
